Update valitydev/java-workflow action to v4#102
Conversation
| jobs: | ||
| build: | ||
| uses: valitydev/java-workflow/.github/workflows/maven-library-build.yml@v3 | ||
| uses: valitydev/java-workflow/.github/workflows/maven-library-build.yml@v4 |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 1 day ago
Generally, to fix this problem you add a permissions: block either at the top level of the workflow (to apply to all jobs) or within specific jobs, explicitly declaring the least privileges your workflow needs. For a build job that only needs to read the repository contents and possibly packages, a minimal safe default is contents: read. You can expand scopes later if the workflow requires it.
For this specific file, .github/workflows/build.yml, the simplest non-breaking fix is to add a root-level permissions section that applies to the build job which reuses the external workflow. This keeps behavior as close as possible to current behavior while constraining GITHUB_TOKEN to read-only repository contents by default. Concretely, insert:
permissions:
contents: readbetween the on: block and the jobs: block. No imports or additional methods are needed; this is purely a YAML configuration change.
| @@ -5,6 +5,9 @@ | ||
| branches: | ||
| - '*' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| uses: valitydev/java-workflow/.github/workflows/maven-library-build.yml@v4 |
This PR contains the following updates:
v3→v4Release Notes
valitydev/java-workflow (valitydev/java-workflow)
v4Compare Source
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.