feat: add reusable SBOM publish and Trivy security scan workflows - #23
Merged
Conversation
Supply-chain CI was per-repo copy-paste, and in practice that meant it mostly did not exist. Two additions so every project gets it by referencing a tag instead of maintaining its own YAML. sbom-publish.yml ---------------- Publishes a CycloneDX SBOM to Dependency-Track. The SBOM comes from either an artifact an upstream job produced - preferred, since a build tool resolves the dependency graph better than any external scanner - or from Trivy, which generates one from the checked-out repository when the project has no generator of its own. It is a standalone job on purpose. AntiRedstoneClock-Remastered 2.9.0 showed the alternative: the SBOM upload sat in the same job as the release publish, so one failing platform upload cost the JAR, both platform releases and the SBOM at once. security-scan.yml ----------------- Trivy scan with findings uploaded to GitHub code scanning. Report-only by default - onboarding a repo should make its vulnerabilities visible, not turn its CI red on day one - with fail-on-findings to gate once a repo is clean. It can scan an artifact from an upstream job instead of the repository, which is what makes a pre-publish gate possible: build, gate on the artifact, and only then publish. Two details that were measured rather than assumed: - limit-severities-for-sarif is on. Without it Trivy ignores `severity` for SARIF output, so code scanning would show a different set than the gate fails on. - rootfs, not fs, is the mode for built JVM artifacts. On the AntiRedstoneClock-Remastered shaded jar, fs reported 0 packages and 0 findings while rootfs reported 12 packages and a HIGH finding. fs on a Gradle source tree without a lockfile finds nothing either - a gate on that looks green because it checked nothing.
TheMeinerLP
force-pushed
the
feat/supply-chain-workflows
branch
from
August 8, 2026 14:39
6bdaf7d to
d1d4cf2
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.
Makes Dependency-Track and Trivy org-wide mechanics instead of per-repo copy-paste. Prompted by the AntiRedstoneClock-Remastered 2.9.0 release, where the SBOM upload lived inside the release job and one rejected platform version cost the JAR, both platform releases and the SBOM in one go.
Preconditions are already in place:
DEPENDENCYTRACK_HOSTNAMEandDEPENDENCYTRACK_APIKEYare organisation secrets, sosecrets: inheritcovers every repo with no per-repo setup.sbom-publish.ymlPublishes a CycloneDX SBOM to Dependency-Track. The SBOM comes from one of two places:
artifact-nameRuns as its own job by design. Dependency-Track being unreachable or rejecting a key must not take down the release that produced the artifact.
security-scan.ymlTrivy scan with findings pushed to GitHub code scanning.
fail-on-findings: truegates once a repo is clean enough to keep it that way.limit-severities-for-sarif: true. Without it Trivy ignoresseverityfor SARIF output and uploads every severity, so code scanning would show a different set than the gate fails on.skip-setup-trivy.Conventions followed
Every input has a description, explicit type and a default unless genuinely required;
secrets: inheritfriendly; concurrency follows the publish-vs-validation split (cancel-in-progress: falsefor the SBOM publish,truefor the scan); required caller permissions documented at the top of each file. Action inputs were verified against the actualaction.ymlofaquasecurity/trivy-action@v0.36.0andDependencyTrack/gh-upload-sbom@v4rather than assumed.Two things worth knowing before adopting
autocreateneedsPROJECT_CREATION_UPLOAD. It defaults totrue, and the Dependency-Track API key's team needs that permission on top ofBOM_UPLOAD— otherwise the server answers403the first time any new version is uploaded. This is exactly what is currently failing for AntiRedstoneClock-Remastered 2.9.0, and it is a server-side key permission, not something this workflow can fix.upload-sarif: false.Follow-up
A companion PR migrates AntiRedstoneClock-Remastered onto both workflows as the first consumer, so this is exercised for real rather than only in theory.
The README examples pin
@v2.6.0, assuming thisfeat:lands as 2.6.0. Worth a glance if release-please picks something else.