Skip to content

ci: fix generate-security-scan-output branch name resolution (main) - #290

Merged
sachinh-amazon merged 1 commit into
mainfrom
fix/security-scan-output-branch-slug
Jul 28, 2026
Merged

ci: fix generate-security-scan-output branch name resolution (main)#290
sachinh-amazon merged 1 commit into
mainfrom
fix/security-scan-output-branch-slug

Conversation

@sachinh-amazon

Copy link
Copy Markdown
Contributor

Issue

Description of Changes

CI logic fix (no security-scan behavior change). The generate-security-scan-output job in .github/workflows/security-scan.yaml referenced ${{ steps.branch-slug.outputs.safe }} in three places (the MATRIX_BRANCH env and the branch success-file upload name/path), but that job never defined a branch-slug step — only the sibling security-scan and security-scan-global-dependencies jobs do.

As a result MATRIX_BRANCH resolved to an empty string, so the "Check if branch was successful for all targets" step looked for scan-success-code-editor-sagemaker-server-.txt (empty branch segment) while the actual uploaded artifact is scan-success-code-editor-sagemaker-server-main.txt — a filename mismatch that failed the job with exit 1 on every main run.

This change adds the same Sanitize branch name step (id: branch-slug) to the generate-security-scan-output job, mirroring the other two jobs, so the branch name resolves and the success-file names match.

Testing

  • YAML validated (yaml.safe_load).
  • Verified the new branch-slug step is defined inside the generate-security-scan-output job before all three steps.branch-slug.outputs.safe references.
  • With matrix.branch = main, safe = main, so the step now looks for scan-success-code-editor-sagemaker-server-main.txt, which matches the artifact produced by the security-scan job.

Screenshots/Videos

N/A

Additional Notes

Pre-existing bug on main only, introduced when this step was changed from matrix.branch to steps.branch-slug.outputs.safe (commit 6e2f17a). The version branches (1.0/1.1/1.2) still use matrix.branch directly and are unaffected. Independent of the recent SBOM/advisory security fixes — the actual security-scan and security-scan-global-dependencies jobs already pass; only this aggregation job was failing.

Backporting

Not needed — the bug is specific to the main copy 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.

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.
@sachinh-amazon
sachinh-amazon requested a review from a team as a code owner July 28, 2026 08:58
@sachinh-amazon
sachinh-amazon added this pull request to the merge queue Jul 28, 2026
Merged via the queue into main with commit d3e7d17 Jul 28, 2026
3 checks passed
@sachinh-amazon
sachinh-amazon deleted the fix/security-scan-output-branch-slug branch July 28, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants