Repository navigation
57 lines (53 loc) · 2.03 KB
/
Copy pathsweep.yml
File metadata and controls
57 lines (53 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Sweep submissions
# The list-writes concurrency group keeps only one pending run, so bursts drop
# runs. This re-dispatches any submission or report left undecided, re-runs a health
# check that hasn't succeeded in 8 days, clears branches from applies that
# died before opening a PR, and closes rot PRs that never merged.
on:
schedule:
- cron: "*/15 * * * *"
workflow_dispatch:
# A finished submission or report frees list-writes, so the next one is dispatched now,
# not at the next 15-minute slot. Neither workflow runs on pull requests, and this job
# checks out main and never reads the triggering run's head.
workflow_run:
workflows: [Submit, Reports]
types: [completed]
permissions: {}
concurrency:
group: sweep
cancel-in-progress: false
jobs:
sweep:
# Only after a success: a failed or rate-limited run would otherwise re-dispatch in a tight loop.
if: >-
github.event_name != 'workflow_run' || (
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_branch == 'main')
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: main
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"
- id: token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
permission-actions: write
permission-contents: write
permission-issues: write
permission-pull-requests: write
- run: python -m scripts.sweep
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}