Skip to content

Commit 1b45ed6

Browse files
committed
ci: generate skills on release-please PR instead of forked renovate PR
Run on release-please's same-repo release PR (release-please--branches--main) so the built-in GITHUB_TOKEN can push the regenerated skills back into the PR. Drops pull_request_target, the SKILLS_GEN_TOKEN PAT, and the fork checkout.
1 parent 3dd8b93 commit 1b45ed6

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

.github/workflows/skills-generate.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,30 @@
1313
# limitations under the License.
1414

1515
name: Generate Skills
16-
# The commit is authored as release-please[bot] so the cla/google check passes.
16+
17+
# Skills are regenerated on release-please's release PR, which is a branch in this
18+
# repo (release-please--branches--main), so the built-in GITHUB_TOKEN can push the
19+
# regenerated skills straight back into the PR -- no fork, no PAT. The commit is
20+
# authored as release-please[bot] so the cla/google check passes.
1721
on:
18-
pull_request_target:
19-
paths:
20-
- "toolbox_version.txt"
22+
pull_request:
2123

2224
permissions:
2325
contents: read
2426

2527
jobs:
2628
generate-skills:
27-
# Restrict to renovate's toolbox bumps
28-
if: >
29-
github.actor == 'renovate-bot' &&
30-
startsWith(github.head_ref, 'renovate/googleapis-mcp-toolbox')
29+
# Only on release-please's release PR. This branch lives in the repo, so the
30+
# GITHUB_TOKEN has write access to push the regenerated skills back into it.
31+
if: startsWith(github.head_ref, 'release-please--branches--main')
3132
runs-on: ubuntu-latest
33+
permissions:
34+
contents: write
3235
steps:
3336
- name: Check out PR branch
3437
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3538
with:
36-
repository: ${{ github.event.pull_request.head.repo.full_name }}
37-
ref: ${{ github.event.pull_request.head.ref }}
38-
token: ${{ secrets.SKILLS_GEN_TOKEN }}
39-
persist-credentials: true
39+
ref: ${{ github.head_ref }}
4040

4141
- name: Generate skills
4242
run: |
@@ -53,8 +53,6 @@ jobs:
5353
./.github/scripts/generate_skills.sh
5454
5555
- name: Commit and push regenerated skills
56-
env:
57-
HEAD_REF: ${{ github.event.pull_request.head.ref }}
5856
run: |
5957
if [ -z "$(git status --porcelain)" ]; then
6058
echo "No skill changes generated. Nothing to commit."
@@ -67,4 +65,4 @@ jobs:
6765
6866
git add .
6967
git commit -m "chore: auto-generate skills for toolbox v$(tr -d '[:space:]' < toolbox_version.txt)"
70-
git push origin "HEAD:$HEAD_REF"
68+
git push

0 commit comments

Comments
 (0)