Skip to content

Conversation

@jpmorby
Copy link
Owner

@jpmorby jpmorby commented Jan 21, 2026

Potential fix for https://github.com/jpmorby/taskman/security/code-scanning/1

In general, the problem is fixed by explicitly declaring a permissions: block that restricts the GITHUB_TOKEN to the minimal scopes required. For this workflow, the steps only need to read repository contents (for actions/checkout) and do not appear to require any write access to GitHub resources such as contents, pull requests, or issues.

The best fix, without changing existing functionality, is to add a permissions: block at the workflow root (top-level, alongside name: and on:). This will apply to all jobs in the workflow, including ci, and limit the token to read-only on repository contents. Concretely, in .github/workflows/tests.yml, add:

permissions:
  contents: read

between the name: tests line and the on: block. No other changes are needed; all existing steps (checkout, setup, install, build, tests, linting) will continue to work, because they only require read access to the repository.

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>
@jpmorby jpmorby marked this pull request as ready for review January 21, 2026 08:37
@jpmorby jpmorby merged commit 9f748d8 into main Jan 21, 2026
5 checks passed
@jpmorby jpmorby deleted the alert-autofix-1 branch January 21, 2026 08:37
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