Update valitydev/java-workflow action to v4#89
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 1 day ago
In general, the fix is to explicitly define a permissions block either at the workflow root (applies to all jobs) or under the specific job. Because this workflow contains a single job build that only calls a reusable workflow, we can safely add a root-level permissions block that restricts the GITHUB_TOKEN to read-only repository contents, which is a safe minimal baseline when we don't see any direct write operations in this snippet.
Best single fix without changing existing functionality: add a root-level permissions section directly under the name: line, before the on: block, specifying least-privilege read access to contents (and optionally packages, but we’ll keep it minimal and only define contents: read as a clear, standard baseline). This does not alter the structure or logic of the existing job; it only constrains the automatic GITHUB_TOKEN that GitHub injects.
Concretely, in .github/workflows/build.yml, insert:
permissions:
contents: readafter line 1 (name: Maven Build Artifact) and before line 3 (on:). No additional imports or methods are needed since this is a YAML workflow configuration change only.
| @@ -1,4 +1,6 @@ | ||
| name: Maven Build Artifact | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: |
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.