Skip to content

Conversation

@devraj
Copy link
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 <[email protected]>
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.

2 participants