Skip to content

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#315

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

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

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/2

To fix the problem, add a permissions block to the workflow to explicitly set the minimum required permissions for the GITHUB_TOKEN. Since the workflow only checks out code and builds with Maven, it only needs read access to repository contents. The best way to do this is to add the following at the top level of the workflow (after the name and before on), or at the job level if only specific jobs need it. In this case, adding it at the workflow level is simplest and most maintainable. No additional methods, imports, or definitions are needed.


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:40
@olibye olibye added this pull request to the merge queue Aug 18, 2025
Merged via the queue into master with commit 9382e02 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