ci: run the dependency graph submission before the CBOM step - #518
Merged
Conversation
The first run on main failed: Error: EACCES: permission denied, scandir '/home/runner/work/sonar-cryptography/sonar-cryptography/76d3.../1508...' The CBOM step is a Docker action. It runs as root with the workspace mounted, and the Sonar Java analyzer inside it leaves temp folders in the workspace. Those folders belong to root and the runner user cannot read them. The dependency submission action walks the whole workspace to find its depgraph files, hits such a folder, and stops. Running it before the CBOM step means it walks a clean workspace. Nothing else depends on the order. It still runs after the clean-tree check, and it only writes into target/, which is ignored.
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.
What
Moves the
Update dependency graphstep so it runs right after the build and the clean-tree check, before theCreate CBOMstep.Why
The step was skipped on pull requests, so #515 went green and then the first run on
mainfailed:The
Create CBOMstep is a Docker action. It runs as root with the workspace mounted at/github/workspace, and the Sonar Java analyzer inside it leaves temp folders in the workspace. Those folders belong to root, so the runner user cannot read them.The dependency submission action walks the whole workspace to collect its depgraph files. It reached one of those root-owned folders and stopped with
EACCES.The fix
Run it before the CBOM step, while the workspace is still clean. Nothing else depends on the order:
maven-dependency-submission-action-depgraph.jsonintotarget/, which is ignored,Testing
The step stays skipped on pull requests (it needs the
mainbranch to submit a snapshot), so CI here cannot prove it. The next push tomainis the real test.