fix(ci): generate-sbom – always checkout latest main, handle same-day reruns - #71
Merged
sei-vsarvepalli merged 3 commits intoAug 2, 2026
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job generate-sbom
fix(ci): generate-sbom – always checkout latest main, handle same-day reruns
Aug 2, 2026
sei-vsarvepalli
approved these changes
Aug 2, 2026
sei-vsarvepalli
left a comment
Collaborator
There was a problem hiding this comment.
This change is helpful lets do it.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the generate-sbom GitHub Actions workflow to make reruns idempotent and ensure SBOMs are generated from the latest main branch state rather than the triggering commit.
Changes:
- Check out
mainexplicitly during the workflow run to avoid generating SBOMs from a stale commit when runs are queued/concurrent. - Force-push the daily
sbom/update-YYYY-MM-DDbranch so same-day reruns update the existing branch instead of failing. - Avoid failing on duplicate PR creation by only creating a PR when one doesn’t already exist for the branch.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
The
generate-sbomworkflow failed on same-day reruns becausegit pushwas rejected when thesbom/update-YYYY-MM-DDbranch already existed on the remote. Additionally, the checkout used the triggering commit SHA rather than the HEAD ofmain, so concurrent or queued runs could generate SBOMs from a stale tree.Changes
main— addref: maintoactions/checkout@v4so SBOM generation always reflects the current state of the default branch, not the specific triggering commit.git push originwithgit push --force originso reruns on the same calendar day update the existing branch rather than erroring out.gh pr createwith a pre-check; if a PR for the branch already exists the step is a no-op (the force-pushed commits are automatically reflected in the open PR).