ci: restructure guards to job-level conditions (fix Scorecard parse)#163
Merged
Conversation
Use the proven pattern from patchloom and attune-io/attune: - changes job: if: github.event_name == 'pull_request' - heavy jobs: if: always() && (needs.changes.result == 'skipped' || needs.changes.outputs.code == 'true') - No more internal "should-run" steps or per-step `steps.xxx.outputs` conditions. This makes the workflow YAML cleanly parsable by Scorecard (no more line 64 "mapping values" errors in Pinned-Dependencies / Token-Permissions / etc.). Removes the complex guard steps that were causing -1 scores. See: patchloom ci.yml and attune ci.yaml for the reference implementation. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
This provides a single always() job that the required checks / branch protection can depend on, while the matrix jobs use the changes filter. This is exactly how patchloom structures its final "ci" job. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
c7ca709 to
390508c
Compare
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.
Restructure the docs-only skip logic in ci.yml to use clean job-level conditions, following the exact pattern used successfully in:
Before (broke Scorecard parser)
if: steps.should-run.outputs.run == 'true' || ...run: |This caused:
on Pinned-Dependencies, Token-Permissions, Dangerous-Workflow, Packaging, SAST → all -1.
After
This should make Scorecard parse the workflows cleanly again (restoring real scores instead of -1 errors).
Also updated the changes job comment.
npm run checkpasses.