Update valitydev/java-workflow action to v4#81
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 17 days ago
In general, the fix is to add an explicit permissions block that limits the GITHUB_TOKEN to the minimal access required. For simple build workflows that only need to read code and (optionally) read packages, a common baseline is contents: read and possibly packages: read. Since we cannot see any other actions in this job (it only reuses a Maven build workflow), and to avoid accidentally breaking behavior that might rely on write permissions (for example, if the reusable workflow publishes build summaries, comments on PRs, or uploads artifacts needing specific scopes), the safest minimal change is to add a root‑level permissions block with read‑only repo contents. This documents the intended restriction and prevents inheriting unnecessarily broad defaults.
Concretely, in .github/workflows/build.yml, add a permissions section at the top level, between name: and on: (or directly under name:) to apply to all jobs in this workflow. The block should be:
permissions:
contents: readThis sets the default GITHUB_TOKEN permissions for all jobs (including the reusable build job) to read‑only access to repository contents, which is usually sufficient for a Maven build. No imports or additional definitions are needed, as this is pure YAML configuration for GitHub Actions.
| @@ -1,5 +1,8 @@ | ||
| name: Maven Build Artifact | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: |
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.