Skip to content

Commit 94f0848

Browse files
committed
ci: regenerate skills via GitHub Actions instead of Cloud Build
Replaces the Cloud Build pipeline (which needed SSH keys and Secret Manager tokens) with a GitHub Actions workflow. On PRs that bump toolbox_version.txt, it regenerates skills and commits them back to the PR branch using the built-in GITHUB_TOKEN. Moves the generator script under .github/scripts/.
1 parent 6ac9473 commit 94f0848

3 files changed

Lines changed: 56 additions & 82 deletions

File tree

.ci/skills-gen.cloudbuild.yaml

Lines changed: 0 additions & 82 deletions
This file was deleted.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Generate Skills
16+
17+
on:
18+
pull_request:
19+
paths:
20+
- "toolbox_version.txt"
21+
22+
jobs:
23+
generate-skills:
24+
# Only run for same-repo PRs (e.g. renovate's toolbox bump), where the
25+
# built-in GITHUB_TOKEN can push back to the PR branch.
26+
if: github.event.pull_request.head.repo.full_name == github.repository
27+
runs-on: ubuntu-latest
28+
permissions:
29+
contents: write
30+
steps:
31+
- name: Check out PR branch
32+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
33+
with:
34+
ref: ${{ github.head_ref }}
35+
36+
- name: Generate skills
37+
run: |
38+
VERSION="$(tr -d '\n' < toolbox_version.txt)"
39+
echo "Detected toolbox version: $VERSION"
40+
export VERSION
41+
chmod +x ./.github/scripts/generate_skills.sh
42+
./.github/scripts/generate_skills.sh
43+
44+
- name: Commit and push regenerated skills
45+
run: |
46+
if [ -z "$(git status --porcelain)" ]; then
47+
echo "No skill changes generated. Nothing to commit."
48+
exit 0
49+
fi
50+
51+
echo "Changes detected. Committing regenerated skills..."
52+
git config user.name "github-actions[bot]"
53+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
54+
git add .
55+
git commit -m "chore: auto-generate skills for toolbox v$(tr -d '\n' < toolbox_version.txt)"
56+
git push

0 commit comments

Comments
 (0)