Skip to content

Potential fix for code scanning alert no. 3: Workflow does not contain permissions#317

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

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

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

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 pushes commits and tags and creates pull requests, it needs contents: write and pull-requests: write permissions. The contents: write permission is required for pushing commits and tags, and pull-requests: write is needed for creating pull requests. The permissions block should be added at the top level of the workflow (after the name and before on:) to apply to all jobs, unless more granular control is needed. No changes to the steps or other logic are required.


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 5e1a951 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