Skip to content

Conversation

@jeffpatton1971
Copy link
Contributor

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

The best way to fix the issue is to explicitly add a permissions block that restricts the workflow's access to the minimum required by its steps. Since the workflow just checks out code (actions/checkout), reads a project file, builds/packages the code, and pushes to NuGet using a secret API key (not needing GITHUB_TOKEN write access), it only needs read access to repository contents. Place a block at the workflow (top/root) level so it applies to all jobs. Concretely, add:

permissions:
  contents: read

after the name: and before the on: block in .github/workflows/build.yml.

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