-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[FEATURE REQUEST] Modify sbom workflow to push to the repo #4621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2524663 to
db63655
Compare
db63655 to
f96ccc5
Compare
f96ccc5 to
2a93706
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the SBOM workflow to generate and push an sbom.json file only on pushes to the default branches, comparing it against the current master to avoid redundant commits.
- Switched from pull_request to push triggers on
masterandmain, and updated permissions towrite. - Generates, cleans, and compares the SBOM JSON against the default branch, committing only if changes are detected.
- Moves the SBOM into the repo root and streamlines the workflow steps.
Comments suppressed due to low confidence (2)
.github/workflows/sbom.yml:20
- The comment states you need the full repository history, but the checkout step lacks
fetch-depth: 0. Addfetch-depth: 0underwith:to ensure all commits are fetched for diff operations.
uses: actions/checkout@v4
.github/workflows/sbom.yml:59
- This always fetches
origin/mastereven when running onmain. To handle both branches, dynamically fetch the current branch (e.g., using${GITHUB_REF##*/}) or fetch bothorigin/masterandorigin/mainbefore comparison.
run: git fetch origin master
joragua
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments here @jesmrec!
46d4613 to
18cb7f2
Compare
joragua
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 💯 Let's see if it works in master branch
Changes:
Replaced the
readpermission forwrite, since we have to pushsbom.jsonto be created when pushing tomaster. Before: in every PR, does not matter the target branch.sbom.jsonfile in root folder of the current repositoryAdded a step that will compare the
sbom.jsoninmasterwith the generated one. If they match, no push (no changes since the latest time).Related Issues
App:
ReleaseNotesViewModel.ktcreating a newReleaseNote()with String resources (if required)QA