Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

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

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI 5 days 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: read

between the on: block and the jobs: block. No imports or additional methods are needed; this is purely a YAML configuration change.

Suggested changeset 1
.github/workflows/build.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -5,6 +5,9 @@
     branches:
       - '*'
 
+permissions:
+  contents: read
+
 jobs:
   build:
     uses: valitydev/java-workflow/.github/workflows/maven-library-build.yml@v4
EOF
@@ -5,6 +5,9 @@
branches:
- '*'

permissions:
contents: read

jobs:
build:
uses: valitydev/java-workflow/.github/workflows/maven-library-build.yml@v4
Copilot is powered by AI and may make mistakes. Always verify output.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

jobs:
deploy:
uses: valitydev/java-workflow/.github/workflows/maven-library-deploy.yml@v3
uses: valitydev/java-workflow/.github/workflows/maven-library-deploy.yml@v4
secrets:
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_TOKEN }}
deploy-secret-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
deploy-secret-key-password: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
mm-webhook-url: ${{ secrets.MATTERMOST_WEBHOOK_URL }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Loading