Skip to content

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

Merged
TimInTech merged 1 commit intomainfrom
alert-autofix-2
Apr 18, 2026
Merged

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#1
TimInTech merged 1 commit intomainfrom
alert-autofix-2

Conversation

@TimInTech
Copy link
Copy Markdown
Owner

Potential fix for https://github.com/TimInTech/Pi-hole-v6.0---Comprehensive-Guide/security/code-scanning/2

Add an explicit top-level permissions block in .github/workflows/ci-sanity.yml so all jobs inherit least-privilege token access.
Best single fix: add:

permissions:
  contents: read

directly under the on: trigger section (before jobs:). This preserves existing functionality (checkout/lint only) while preventing unintended write-capable token usage if repo/org defaults are broad.

No imports, methods, or extra definitions are needed—just YAML configuration in the existing workflow file.

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>
@TimInTech TimInTech marked this pull request as ready for review April 18, 2026 11:35
@TimInTech TimInTech merged commit 7c84943 into main Apr 18, 2026
5 of 7 checks passed
@TimInTech TimInTech deleted the alert-autofix-2 branch April 18, 2026 11:35
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