Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/cleanup-runs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ on:
required: false
default: '1'

# Deleting runs requires actions: write. Everything else stays least-privilege.
# Read-only at the workflow level, so any job added to this file starts with nothing. The
# write scope belongs to the single job below and is declared there, next to the step that
# needs it.
permissions:
actions: write
contents: read

concurrency:
Expand All @@ -34,6 +35,13 @@ jobs:
cleanup:
runs-on: ubuntu-latest
timeout-minutes: 15

# actions: write is used by exactly one step below, "Delete old runs of the high-frequency
# workflows" (DELETE /repos/{repo}/actions/runs/{id}). Deleting runs is what this workflow
# is for, so dropping it leaves the job with nothing to do.
permissions:
actions: write
contents: read
env:
GH_TOKEN: ${{ github.token }}
KEEP: ${{ github.event.inputs.keep || '1' }}
Expand Down