Add Z-Skip-Sonar check#31409
Merged
Merged
Conversation
t3chguy
reviewed
Dec 3, 2025
Comment on lines
+12
to
+43
| check-skip-label: | ||
| name: Check for skip label | ||
| runs-on: ubuntu-latest | ||
| if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event != 'merge_group' | ||
| outputs: | ||
| should-skip: ${{ steps.check-labels.outputs.skip }} | ||
| permissions: | ||
| pull-requests: read | ||
| steps: | ||
| - name: Check labels | ||
| id: check-labels | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const prs = context.payload.workflow_run.pull_requests; | ||
|
|
||
| if (prs.length === 0) { | ||
| core.setOutput('skip', 'false'); | ||
| return; | ||
| } | ||
|
|
||
| // Get full PR details including labels | ||
| const { data: pr } = await github.rest.pulls.get({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: prs[0].number | ||
| }); | ||
|
|
||
| const hasSkipLabel = pr.labels.some(label => label.name === 'Z-Skip-Sonar'); | ||
| core.setOutput('skip', hasSkipLabel ? 'true' : 'false'); | ||
|
|
||
| console.log(`PR #${pr.number}: ${hasSkipLabel ? 'Skipping' : 'Running'} SonarQube`); |
Member
There was a problem hiding this comment.
For ease of maintenance, can we match existing workflows please https://github.com/element-hq/element-web/blob/develop/.github/workflows/tests.yml#L105-L114
Member
Author
There was a problem hiding this comment.
Thanks for pointing me in the right direction.
dbkr
approved these changes
Dec 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a label to allow the the madatory sonarcube check to be skipped in exceptional circumstances(the effort to get the last % is inordinately high, we don't agree with it's recommendations, etc).