gradle / gradle-build-action

Execute your Gradle build and trigger dependency submission
https://github.com/marketplace/actions/gradle-build-action
MIT License
679 stars 97 forks source link

Fail workflow if permissions do not allow dependency graph submission #997

Closed pioterj closed 10 months ago

pioterj commented 11 months ago

When the submission of dependency graph is enabled via with: dependency-graph: generate-and-submit but permissions are not sufficient with permissions: contents: read instead of write, the following warning in the annotations in summary of the build is displayed:

Failed to submit dependency graph dependency-graph-reports/build_description_service-build.json. Please ensure that the 'contents: write' permission is available for the workflow job. Note that this permission is never available for a 'pull_request' trigger from a repository fork.

The build still passes which makes it easy to miss. It would be better to fail the workflow run in case such misconfiguration is detected.