|
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | 15 | 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. |
17 | 21 | on: |
18 | | - pull_request_target: |
19 | | - paths: |
20 | | - - "toolbox_version.txt" |
| 22 | + pull_request: |
21 | 23 |
|
22 | 24 | permissions: |
23 | 25 | contents: read |
24 | 26 |
|
25 | 27 | jobs: |
26 | 28 | 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') |
31 | 32 | runs-on: ubuntu-latest |
| 33 | + permissions: |
| 34 | + contents: write |
32 | 35 | steps: |
33 | 36 | - name: Check out PR branch |
34 | 37 | uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
35 | 38 | 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 }} |
40 | 40 |
|
41 | 41 | - name: Generate skills |
42 | 42 | run: | |
|
53 | 53 | ./.github/scripts/generate_skills.sh |
54 | 54 |
|
55 | 55 | - name: Commit and push regenerated skills |
56 | | - env: |
57 | | - HEAD_REF: ${{ github.event.pull_request.head.ref }} |
58 | 56 | run: | |
59 | 57 | if [ -z "$(git status --porcelain)" ]; then |
60 | 58 | echo "No skill changes generated. Nothing to commit." |
|
67 | 65 |
|
68 | 66 | git add . |
69 | 67 | 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