Skip to content

Comments

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

Merged
isometry merged 1 commit intomainfrom
hotfix/test-permissions
Dec 6, 2025
Merged

Potential fix for code scanning alert no. 3: Workflow does not contain permissions#22
isometry merged 1 commit intomainfrom
hotfix/test-permissions

Conversation

@isometry
Copy link
Owner

@isometry isometry commented Dec 6, 2025

Potential fix for https://github.com/isometry/setup-generic-tool/security/code-scanning/3

To fix the problem, we should add a permissions block to restrict the GITHUB_TOKEN's access for this workflow. The block can be added either at the workflow root level (before the jobs: key) or at the job level. Given there is only one job, adding at the root is clean and guarantees coverage for future jobs. "contents: read" is the minimal permission allowing access to the repository's content and code, which is necessary for actions/checkout and all the operations in this workflow.

The change is simply to add the following block:

permissions:
  contents: read

This should be inserted after the name: (line 1) and before the on: (line 3) in the provided YAML file.

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

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@isometry isometry marked this pull request as ready for review December 6, 2025 11:14
@isometry isometry merged commit 1bc83d0 into main Dec 6, 2025
4 checks passed
@isometry isometry deleted the hotfix/test-permissions branch December 6, 2025 11:19
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