Skip to content

stale workflow: update permissions#25287

Merged
craig-osterhout merged 1 commit into
docker:mainfrom
craig-osterhout:stale-workflow-fix
Jun 5, 2026
Merged

stale workflow: update permissions#25287
craig-osterhout merged 1 commit into
docker:mainfrom
craig-osterhout:stale-workflow-fix

Conversation

@craig-osterhout
Copy link
Copy Markdown
Contributor

@craig-osterhout craig-osterhout commented Jun 5, 2026

Description

Fix stale action not closing PRs due to missing actions: write permission

The stale action uses GitHub Actions cache to persist state between runs. Without actions: write, it can't delete its _state cache entry (fails with 403), so the old state accumulates and PRs in that cached state are permanently skipped with processed during the previous run, meaning they never get evaluated for closing.

Confirmed via Actions logs: PR #23598 was marked stale on April 24 but has never been evaluated for closing because it appears in the stuck cache state every run.

Related issues or tickets

Reviews

  • Technical review
  • Editorial review
  • Product review

Signed-off-by: Craig Osterhout <craig.osterhout@docker.com>
@craig-osterhout craig-osterhout requested a review from a team June 5, 2026 17:39
@craig-osterhout craig-osterhout added the status/review Pull requests that are ready for review label Jun 5, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 5, 2026

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit b76bc52
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/6a2309c8ec2dbb000890bcd2
😎 Deploy Preview https://deploy-preview-25287--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added area/release Relates to CI or deployment ci ci updates labels Jun 5, 2026
Copy link
Copy Markdown

@docker-agent docker-agent left a comment

Choose a reason for hiding this comment

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

Assessment: 🟢 APPROVE

This is a correct and well-scoped fix. Adding actions: write is the documented requirement for actions/stale v9+ to delete its cache-based state between runs, and the inline comment accurately describes the reason. The permission is scoped to the job level, and the job only runs the pinned actions/stale action.

permissions:
issues: write
pull-requests: write
actions: write # required for actions/stale to delete its state cache between runs
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[LOW] actions: write grants broader workflow permissions beyond cache deletion

actions: write is the minimal permission that satisfies actions/stale's requirement to delete its _state cache entry, and the inline comment is accurate. However, this permission also implicitly allows cancelling, re-running, or deleting other workflow runs in the repository. The risk is low given the job only runs the pinned actions/stale action, but worth noting for awareness.

No change needed — this is informational only.

Copy link
Copy Markdown
Contributor

@dvdksn dvdksn left a comment

Choose a reason for hiding this comment

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

LGTM

@craig-osterhout craig-osterhout merged commit 7623c1d into docker:main Jun 5, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/release Relates to CI or deployment ci ci updates status/review Pull requests that are ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants