Skip to content

Potential fix for code scanning alert no. 1: Workflow does not contain permissions - #105

Merged
reece merged 2 commits into
mainfrom
alert-autofix-1
Oct 20, 2026
Merged

reece merged 2 commits into
mainfrom
alert-autofix-1

Conversation

@reece

@reece reece commented Oct 14, 2026

Copy link
Copy Markdown
Member

Potential fix for https://github.com/biocommons/python-package/security/code-scanning/1

Add an explicit permissions block in .github/workflows/stale.yml at the workflow root so it applies to the reusable-workflow job call.
For a stale issue/PR management workflow, the minimal practical least-privilege set is typically:

  • contents: read (safe baseline read access),
  • issues: write (to comment/close stale issues),
  • pull-requests: write (to comment/close stale PRs).

This change preserves behavior while making permissions explicit and restricted.

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

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@reece
reece marked this pull request as ready for review October 14, 2026 18:52
@reece
reece requested a review from a team as a code owner October 14, 2026 18:52
@reece
reece requested a balanced review from Copilot October 19, 2026 20:39
@reece
reece enabled auto-merge October 19, 2026 20:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The narrowly scoped permissions support stale-management operations, with no blocking issues identified.

No open issues 🎉

What changed in this PR

Adds explicit token permissions to the stale-management workflow to address the code-scanning alert.

Changes:

  • Grants read access to contents and write access to issues and pull requests.
  • Applies permissions at workflow scope to the reusable-workflow call.
File Description
.github/​workflows/​stale.yml Defines explicit permissions for stale issue and PR management.

Review effort: Balanced

@reece
reece merged commit 202ab42 into main Oct 20, 2026
16 checks passed
@reece
reece deleted the alert-autofix-1 branch October 20, 2026 16:02
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.

3 participants