[AAASM-235] 🔧 (ci): Harden SonarCloud guard in reusable CI workflow#23
Merged
Merged
Conversation
Replace invalid step-level secrets check with actor-based job guard. The secrets context is not available in step if: expressions within workflow_call workflows, which caused 0s "workflow file issue" failures. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
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.



Description
Two targeted hardening changes to
.github/workflows/rw_run_all_test_and_record.yaml:sonar_token: required: false— corrects the secret declaration fromrequired: truetorequired: false. GitHub does not pass secrets to Dependabot PR runs, so marking it required is misleading and could cause validation warnings.if: ${{ secrets.sonar_token != '' }}on the SonarCloud Scan step — adds an explicit empty-token guard as defense-in-depth alongside the existing label-based skip. If thedependencieslabel is ever removed or renamed, this guard still prevents the SonarCloud step from running with an empty token.The existing label-based guard (
!contains(github.event.pull_request.labels.*.name, 'dependencies')) remains in place on the Codecov and SonarCloud jobs and continues to be the primary mechanism. This PR makes the SonarCloud step additionally resilient at the step level.Type of Change
Breaking Changes
Related Issues
Testing
CI change only — pre-commit run against the specific changed file passes cleanly. The changes are additive guards and do not affect workflow behaviour for normal human-authored PRs.
Checklist