Skip to content

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

Merged
markhallen merged 2 commits intomainfrom
alert-autofix-2
Sep 15, 2025
Merged

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#22
markhallen merged 2 commits intomainfrom
alert-autofix-2

Conversation

@markhallen
Copy link
Owner

Potential fix for https://github.com/markhallen/slack-github-threads/security/code-scanning/2

The best way to fix the problem is to add an explicit permissions block to the workflow YAML, either at the root level (to apply to all jobs) or per-job (for fine-grained control). According to best-practices, you should set the minimum necessary permissions – and in this workflow, all jobs only need permission to read repository content in order to check-out code. Therefore, set permissions: contents: read at the root level, immediately after the workflow name: line and before the on: block. This change doesn't affect existing functionality and provides least-privilege security, so no further methods, imports, or definitions are needed.

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

markhallen and others added 2 commits September 15, 2025 10:26
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@markhallen markhallen marked this pull request as ready for review September 15, 2025 09:27
@markhallen markhallen merged commit 47cb0eb into main Sep 15, 2025
8 checks passed
@markhallen markhallen deleted the alert-autofix-2 branch September 15, 2025 09:28
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

Comments