Potential fix for code scanning alert no. 37: Workflow does not contain permissions#2486
Merged
JoernBerkefeld merged 1 commit intomainfrom Feb 11, 2026
Merged
Potential fix for code scanning alert no. 37: Workflow does not contain permissions#2486JoernBerkefeld merged 1 commit intomainfrom
JoernBerkefeld merged 1 commit intomainfrom
Conversation
…in permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Coverage ReportCommit:e34e019Base: main@0f40991
Details (changed files):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Potential fix for https://github.com/Accenture/sfmc-devtools/security/code-scanning/37
In general, the fix is to define explicit
permissionsfor theGITHUB_TOKENso that the workflow does not rely on repository or organization defaults. This is done by adding apermissions:block either at the root of the workflow (applying to all jobs) or under the specific job that uses the token. We should grant only the scopes required by the action that closes issues related to merged pull requests.Specifically for this workflow,
ldez/gha-mjolnircloses issues that are referenced from merged pull requests. That requires write access to issues and at most read access to pull requests and repository contents. We can therefore add a job-levelpermissionsblock undercloseIssueOnPrMergeTriggerthat sets:contents: read(to mirror minimum recommended access),pull-requests: read(to inspect the merged PR), andissues: write(to close/update related issues).No changes to existing steps or environment variables are needed. The only change is to insert the
permissionsmapping just undercloseIssueOnPrMergeTrigger:and aligned withruns-on:.Suggested fixes powered by Copilot Autofix. Review carefully before merging.