Skip to content

Conversation

@rkttu
Copy link
Member

@rkttu rkttu commented Dec 28, 2025

Potential fix for https://github.com/yourtablecloth/TableCloth/security/code-scanning/7

In general, this issue is fixed by explicitly defining a permissions: block that limits the GITHUB_TOKEN to the minimum scopes required by the workflow. This can be set at the top level (applies to all jobs) or per job (overrides the top-level setting). For this workflow, the jobs only need to read the repository contents to perform checkout and build; they do not create releases, comment on issues/PRs, or push changes, so contents: read is sufficient.

The single best fix without changing existing functionality is to add a top‑level permissions: block right after the name: (or before/after on:) that sets contents: read. This will apply to both validate-version and build jobs, and is compatible with actions/checkout, actions/setup-dotnet, and actions/upload-artifact, which do not require write permissions to repository contents. No other code changes, methods, or imports are needed: we only adjust the YAML configuration.

Concretely, in .github/workflows/build.yml, insert:

permissions:
  contents: read

near the top of the file (e.g., between line 1 and line 3 in the snippet provided). No additional permissions appear necessary given the current steps.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

@rkttu rkttu self-assigned this Dec 29, 2025
@rkttu rkttu closed this Dec 29, 2025
@rkttu rkttu deleted the alert-autofix-7 branch December 29, 2025 02:18
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