Skip to content

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#316

Merged
olibye merged 1 commit into
masterfrom
alert-autofix-1
Aug 18, 2025
Merged

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#316
olibye merged 1 commit into
masterfrom
alert-autofix-1

Conversation

@olibye

@olibye olibye commented Aug 18, 2025

Copy link
Copy Markdown
Member

Potential fix for https://github.com/jmock-developers/jmock-library/security/code-scanning/1

To fix the problem, we should add a permissions block to the workflow to restrict the permissions granted to the GITHUB_TOKEN. The best way to do this is to add the block at the top level of the workflow (before jobs:), so it applies to all jobs unless overridden. For a Maven deploy workflow, the minimal required permission is usually contents: read, unless the workflow needs to create issues, pull requests, or interact with other resources. If later steps require additional permissions, they can be added as needed. The change should be made at the top of the .github/workflows/snapshot.yml file, immediately after the name: and before on: or jobs:.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@olibye olibye marked this pull request as ready for review August 18, 2025 12:53
@olibye olibye added this pull request to the merge queue Aug 18, 2025
Merged via the queue into master with commit 419e43e Aug 18, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant