Skip to content

Potential fix for code scanning alert no. 7: Workflow does not contain permissions#112

Merged
abelcheung merged 1 commit into
mainfrom
alert-autofix-7
Jan 9, 2026
Merged

Potential fix for code scanning alert no. 7: Workflow does not contain permissions#112
abelcheung merged 1 commit into
mainfrom
alert-autofix-7

Conversation

@abelcheung
Copy link
Copy Markdown
Owner

Potential fix for https://github.com/abelcheung/types-lxml/security/code-scanning/7

To fix the problem, add an explicit permissions block to the build job so that the GITHUB_TOKEN is restricted instead of inheriting repository defaults. Since the build job only dispatches a reusable workflow and passes gitref, it almost certainly needs at most read access to repository contents. A safe, minimal starting point consistent with GitHub’s recommendations is permissions: contents: read.

Concretely, in .github/workflows/release.yml, under jobs: build:, insert a permissions: mapping before uses:. This will apply only to the build job and will not affect the other jobs, which already declare their own permissions. No additional methods, imports, or definitions are needed since this is just a YAML configuration change.

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

…ntain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@abelcheung abelcheung self-assigned this Jan 9, 2026
@abelcheung abelcheung added the build/ci Issues related to building or CI/CD label Jan 9, 2026
@abelcheung abelcheung marked this pull request as ready for review January 9, 2026 16:25
@abelcheung abelcheung merged commit 7a241de into main Jan 9, 2026
54 checks passed
@abelcheung abelcheung deleted the alert-autofix-7 branch January 9, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build/ci Issues related to building or CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant