Update valitydev/java-workflow action to v4#65
Conversation
| jobs: | ||
| build: | ||
| uses: valitydev/java-workflow/.github/workflows/maven-service-build.yml@v3 | ||
| uses: valitydev/java-workflow/.github/workflows/maven-service-build.yml@v4 |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 27 days ago
In general, the fix is to explicitly specify the minimal required GITHUB_TOKEN permissions using a permissions: block, either at the workflow root (applies to all jobs) or at the job level (overrides root for that job). Since this workflow has only a single job, adding permissions at the root is simple and clearly documents the intent. The minimal safe starting point GitHub recommends is contents: read, which is sufficient for most CI build jobs that only need to read source code and metadata.
The best fix here without changing existing functionality is to add a root-level permissions: block just below the name: or on: section, with conservative read-only permissions. Given that this is a Maven build job using a reusable workflow, it very likely only needs to read repository contents; unless we know it needs more, we should set contents: read. This does not interfere with the uses: reference to the reusable workflow and preserves existing behavior while ensuring the GITHUB_TOKEN is not over-privileged by default. Concretely, in .github/workflows/build.yml, insert:
permissions:
contents: readnear the top of the file (e.g., after name: and before on:). No imports or extra definitions are needed for YAML workflows.
| @@ -1,5 +1,8 @@ | ||
| name: Maven Build Artifact | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: |
4e24e4f to
f63b7ae
Compare
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.