Skip to content

Potential fix for code scanning alert no. 10: Workflow does not contain permissions#109

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

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

Conversation

@abelcheung

Copy link
Copy Markdown
Owner

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

In general, the fix is to explicitly set a permissions block at the workflow level (applies to all jobs) or per job, restricting the GITHUB_TOKEN to the minimal scopes needed. For this workflow, the jobs only need to interact with actions artifacts; they don't push commits or manage issues/PRs. Thus we can safely set permissions: contents: read at the workflow root as a conservative baseline (the minimum GitHub recommends for most workflows) while leaving the existing actions: write permission on the log-aggregation job, which is already explicitly configured for cleaning up artifacts.

The single best fix without changing functionality is:

  • Add a workflow-level permissions block just after the name: line.
  • Set contents: read there, which is sufficient for typical artifact operations and avoids unnecessary write privileges.
  • Keep the existing permissions on the log-aggregation job as-is, since it explicitly needs actions: write for geekyeggo/delete-artifact@v5.

All required changes are confined to .github/workflows/test_inc.yml, and no imports or additional methods are involved since this is a YAML configuration change only.

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

…ontain 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 13:37
@abelcheung abelcheung merged commit 86af863 into main Jan 9, 2026
4 checks passed
@abelcheung abelcheung deleted the alert-autofix-10 branch January 9, 2026 13:38
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