Repository navigation
71 lines (66 loc) · 2.36 KB
/
Copy pathcontroller.yml
File metadata and controls
71 lines (66 loc) · 2.36 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: controller
# A deterministic, label-only controller (AGENTS.md › Controller): no LLM, no
# secrets, only the built-in GITHUB_TOKEN. It never merges, approves, comments
# on or closes anything and never checks out or runs a PR or issue: their text
# is data for a regex, the changed files are read through the API. Script and
# rules come from the default branch.
#
# Switches (repository variables):
# CONTROLLER_LIVE exactly `true` -> the `apply` job writes labels; anything
# else -> dry run, the plan goes to the job summary.
# AGENT_PAUSE `true` -> kill switch: nothing is read, proposed or changed.
# To turn it off entirely, disable this workflow in the Actions tab.
on:
schedule:
- cron: '7,37 * * * *'
workflow_dispatch:
concurrency:
group: controller
cancel-in-progress: false
permissions: {}
jobs:
plan:
name: plan (read only)
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
issues: read
pull-requests: read
outputs:
live: ${{ steps.plan.outputs.live }}
plan: ${{ steps.plan.outputs.plan }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.repository.default_branch }}
persist-credentials: false
- id: plan
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
CONTROLLER_LIVE: ${{ vars.CONTROLLER_LIVE }}
AGENT_PAUSE: ${{ vars.AGENT_PAUSE }}
run: python3 .github/scripts/controller.py plan
apply:
name: apply labels (live only)
needs: plan
if: needs.plan.outputs.live == 'true' && vars.CONTROLLER_LIVE == 'true' && vars.AGENT_PAUSE != 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
issues: write
pull-requests: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.repository.default_branch }}
persist-credentials: false
- env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
CONTROLLER_LIVE: ${{ vars.CONTROLLER_LIVE }}
AGENT_PAUSE: ${{ vars.AGENT_PAUSE }}
PLAN: ${{ needs.plan.outputs.plan }}
run: python3 .github/scripts/controller.py apply