Skip to content

Commit 5613667

Browse files
committed
ci: create PR instead of committing directly to main for skill updates
Replaces the manual branch checkout and commit process in the update-skill workflow with the `peter-evans/create-pull-request` action. This ensures changes are reviewed via a Pull Request before merging to main.
1 parent 6b6eaab commit 5613667

1 file changed

Lines changed: 12 additions & 20 deletions

File tree

.github/workflows/update-skill.yml

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,15 @@ jobs:
5252
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
5353
run: python .github/scripts/update_skill.py
5454

55-
- name: Commit and Push Changes
56-
run: |
57-
git config user.name "github-actions[bot]"
58-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
59-
60-
# Checkout main branch to push the update there
61-
git checkout main
62-
63-
# Copy the updated file to the main branch
64-
git checkout ${GITHUB_REF_NAME} -- .gemini/skills/android-maps-compose/SKILL.md
65-
66-
git add .gemini/skills/android-maps-compose/SKILL.md
67-
68-
# Only commit if there are changes
69-
if ! git diff-index --quiet HEAD; then
70-
git commit -m "docs: update SKILL.md based on release ${GITHUB_REF_NAME} diff [skip ci]"
71-
git push origin main
72-
else
73-
echo "No changes in SKILL.md"
74-
fi
55+
- name: Create Pull Request
56+
uses: peter-evans/create-pull-request@v7
57+
with:
58+
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
59+
commit-message: "docs: update SKILL.md based on release ${{ github.ref_name }}"
60+
title: "docs: update SKILL.md for release ${{ github.ref_name }}"
61+
body: "Automatically generated PR to update \`SKILL.md\` for the latest release \`${{ github.ref_name }}\`."
62+
branch: "update-skill-for-${{ github.ref_name }}"
63+
base: main
64+
labels: |
65+
docs
66+
automerge

0 commit comments

Comments
 (0)