Skip to content

Commit 29bca8b

Browse files
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

File tree

.github/workflows/generate-enums.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v6
19+
with:
20+
# PAT with workflows scope so the push can touch .github/workflows/*
21+
# and so the opened PR triggers CI (GITHUB_TOKEN cannot do either).
22+
token: ${{ secrets.GENERATE_ENUMS_TOKEN }}
1923

2024
- name: Install uv
2125
uses: astral-sh/setup-uv@v7
@@ -45,6 +49,7 @@ jobs:
4549
- name: Create pull request
4650
uses: peter-evans/create-pull-request@v8
4751
with:
52+
token: ${{ secrets.GENERATE_ENUMS_TOKEN }}
4853
commit-message: "Update generated enums and docs from Overkiz API"
4954
title: "Update generated enums and docs from Overkiz API"
5055
body: |

0 commit comments

Comments
 (0)