Skip to content

Potential fix for code scanning alert no. 5: Workflow does not contain permissions#98

Merged
devraj merged 1 commit intomasterfrom
alert-autofix-5
Feb 16, 2026
Merged

Potential fix for code scanning alert no. 5: Workflow does not contain permissions#98
devraj merged 1 commit intomasterfrom
alert-autofix-5

Conversation

@devraj
Copy link
Copy Markdown
Member

@devraj devraj commented Jan 14, 2026

Potential fix for https://github.com/anomaly/gallagher/security/code-scanning/5

To fix the problem, add an explicit permissions block to the workflow to limit the permissions granted to the GITHUB_TOKEN. The optimal location in this case is at the workflow root (above jobs:) if all jobs require the same permissions, otherwise, place it inside individual jobs. Since this workflow is for publishing documentation using GitHub Pages, it typically only needs permission to read and write content within the repository. The minimal safe permissions are contents: write. If you are certain that only read is needed, you may use contents: read, but publishing likely requires write access. Therefore, above the jobs: key, insert:

permissions:
  contents: write

No imports or definitions are involved; this is a declarative YAML change.

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>
Signed-off-by: Dev Mukherjee <devraj@gmail.com>
@devraj devraj marked this pull request as ready for review February 16, 2026 20:57
@devraj devraj merged commit b7507ac into master Feb 16, 2026
3 of 4 checks passed
@devraj devraj deleted the alert-autofix-5 branch February 16, 2026 20:57
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