Skip to content

Conversation

@jeffpatton1971
Copy link
Contributor

Potential fix for https://github.com/mod-posh/xml2doc/security/code-scanning/4

To fix the problem, explicitly declare a permissions: block at the top level of the workflow (recommended) or for the affected job. This ensures that only the necessary permissions are granted to the workflow's GITHUB_TOKEN, reducing security risks.

Given that this workflow pushes to branches, creates releases, and interacts with repository content, at minimum it requires contents: write, and possibly also pull-requests: write or issues: write if those operations are performed. However, based on the workflow shown, contents: write is required for pushing documentation and creating releases. To adhere to the principle of least privilege, set:

permissions:
  contents: write

Add this block immediately after the name: field and before on: in .github/workflows/release.yml. No other changes or imports are needed.


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>
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