Skip to content

Commit 47efde2

Browse files
fix(ci): use PR instead of direct push for tool versions update (#11)
Branch protection on main requires changes through a pull request. Update the workflow to create a PR from an auto/ branch instead of pushing directly to main. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8d81f04 commit 47efde2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/update-tool-versions.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
permissions:
1010
contents: write
11+
pull-requests: write
1112

1213
jobs:
1314
update-versions:
@@ -32,11 +33,22 @@ jobs:
3233
echo "changed=true" >> "$GITHUB_OUTPUT"
3334
fi
3435
35-
- name: Commit and push
36+
- name: Create pull request
3637
if: steps.diff.outputs.changed == 'true'
38+
env:
39+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3740
run: |
41+
branch="auto/update-tool-versions"
3842
git config user.name "github-actions[bot]"
3943
git config user.email "github-actions[bot]@users.noreply.github.com"
44+
git checkout -B "$branch"
4045
git add content/docs/container/versions.md
4146
git commit -m "docs(container): update tool versions page"
42-
git push
47+
git push -f origin "$branch"
48+
if ! gh pr list --head "$branch" --state open --json number -q '.[0].number' | grep -q .; then
49+
gh pr create \
50+
--title "docs(container): update tool versions page" \
51+
--body "Automated daily update of tool versions from the latest dev-toolchain release." \
52+
--head "$branch" \
53+
--base main
54+
fi

0 commit comments

Comments
 (0)