ci: fix generate-security-scan-output branch name resolution (main) - #290
Merged
Merged
Conversation
The generate-security-scan-output job referenced steps.branch-slug.outputs.safe but never defined a branch-slug step, so MATRIX_BRANCH resolved to empty and the per-branch success-file name never matched the uploaded artifact, failing the aggregation step on every main run. Add the Sanitize branch name step (mirroring the security-scan and security-scan-global-dependencies jobs) so the branch name resolves correctly.
azmkercso
approved these changes
Jul 28, 2026
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.
Issue
Description of Changes
CI logic fix (no security-scan behavior change). The
generate-security-scan-outputjob in.github/workflows/security-scan.yamlreferenced${{ steps.branch-slug.outputs.safe }}in three places (theMATRIX_BRANCHenv and the branch success-file upload name/path), but that job never defined abranch-slugstep — only the siblingsecurity-scanandsecurity-scan-global-dependenciesjobs do.As a result
MATRIX_BRANCHresolved to an empty string, so the "Check if branch was successful for all targets" step looked forscan-success-code-editor-sagemaker-server-.txt(empty branch segment) while the actual uploaded artifact isscan-success-code-editor-sagemaker-server-main.txt— a filename mismatch that failed the job with exit 1 on everymainrun.This change adds the same
Sanitize branch namestep (id: branch-slug) to thegenerate-security-scan-outputjob, mirroring the other two jobs, so the branch name resolves and the success-file names match.Testing
yaml.safe_load).branch-slugstep is defined inside thegenerate-security-scan-outputjob before all threesteps.branch-slug.outputs.safereferences.matrix.branch = main,safe = main, so the step now looks forscan-success-code-editor-sagemaker-server-main.txt, which matches the artifact produced by thesecurity-scanjob.Screenshots/Videos
N/A
Additional Notes
Pre-existing bug on
mainonly, introduced when this step was changed frommatrix.branchtosteps.branch-slug.outputs.safe(commit 6e2f17a). The version branches (1.0/1.1/1.2) still usematrix.branchdirectly and are unaffected. Independent of the recent SBOM/advisory security fixes — the actualsecurity-scanandsecurity-scan-global-dependenciesjobs already pass; only this aggregation job was failing.Backporting
Not needed — the bug is specific to the
maincopy of the workflow; 1.0/1.1/1.2 do not have it.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.