Commit 29bca8b
authored
Use PAT for generate-enums so it can push workflow changes (#2082)
## Problem
The weekly `generate-enums` workflow failed at the **Create pull
request** step. All the real work (fetch server data, generate enums,
generate device catalog docs) succeeded — only the push was rejected:
```
! [remote rejected] automated/generate-enums -> automated/generate-enums
(refusing to allow a GitHub App to create or update workflow `.github/workflows/docs.yml`
without `workflows` permission)
```
The default `GITHUB_TOKEN` is categorically forbidden from pushing
changes under `.github/workflows/` — this can't be granted via the
`permissions:` block. `docs.yml` drifted into the diff because the stale
`automated/generate-enums` branch was based on an older `main`.
## Fix
Use a fine-grained PAT (`GENERATE_ENUMS_TOKEN`, stored in the
`overkiz-api` environment with Contents / Pull requests / Workflows
write) for both the `checkout` and `create-pull-request` steps. As a
bonus, PRs opened with a PAT trigger CI (those opened with
`GITHUB_TOKEN` don't).
Manual dispatch (`workflow_dispatch`) was already enabled.
## Follow-up (not in this PR)
`peter-evans/create-pull-request@v7` runs on Node 20, which GitHub
force-migrates to Node 24 on 2026-06-02 — worth bumping soon.1 parent 9a6244f commit 29bca8b
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| 52 | + | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
| |||
0 commit comments