Skip to content

Commit c8ac5a9

Browse files
authored
Update version bumper (#115)
* use gh cli * test * revert test
1 parent b627ba0 commit c8ac5a9

File tree

1 file changed

+31
-13
lines changed

1 file changed

+31
-13
lines changed

.github/workflows/check-emulator-version.yaml

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check Emulator Version
1+
name: Bump Emulator Version
22

33
on:
44
schedule:
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
check-emulator-version:
11+
bump-emulator-version:
1212
name: Check for new emulator version
1313
runs-on: ubuntu-latest
1414
permissions:
@@ -17,6 +17,8 @@ jobs:
1717
steps:
1818
- name: Check out the repo
1919
uses: actions/checkout@v4
20+
with:
21+
ref: master
2022

2123
- name: Get current version and check for newer versions
2224
id: version-check
@@ -171,14 +173,30 @@ jobs:
171173

172174
- name: Create Pull Request
173175
if: steps.process-versions.outputs.updated == 'true'
174-
uses: peter-evans/create-pull-request@v6
175-
with:
176-
commit-message: "chore: update emulator version to ${{ steps.process-versions.outputs.updated_version }}"
177-
title: "chore: update emulator version to ${{ steps.process-versions.outputs.updated_version }}"
178-
body: |
179-
This PR updates the Cloud Spanner emulator version from ${{ steps.version-check.outputs.current_version }} to ${{ steps.process-versions.outputs.updated_version }}.
180-
181-
This PR was automatically generated by the check-emulator-version workflow.
182-
branch: update-emulator-version
183-
base: master
184-
delete-branch: true
176+
env:
177+
GH_TOKEN: ${{ secrets.CREATE_PR_PAT }}
178+
CURRENT_VERSION: ${{ steps.version-check.outputs.current_version }}
179+
UPDATED_VERSION: ${{ steps.process-versions.outputs.updated_version }}
180+
run: |
181+
# Create and checkout a new branch
182+
git branch -d bump-base-version &>/dev/null || true
183+
git checkout -b bump-base-version
184+
185+
# Commit the changes
186+
git config --global user.name "GitHub Actions"
187+
git config --global user.email "actions@github.com"
188+
git commit -am "chore: update emulator version to $UPDATED_VERSION"
189+
190+
# Push the branch (force push to handle case where branch exists remotely)
191+
git push -f -u origin bump-base-version
192+
193+
# Create the PR
194+
gh pr create \
195+
--title "chore: update emulator version to $UPDATED_VERSION" \
196+
--body "This PR updates the Cloud Spanner emulator version from $CURRENT_VERSION to $UPDATED_VERSION.
197+
Original Release Notes: https://github.com/GoogleCloudPlatform/cloud-spanner-emulator/releases/tag/v$UPDATED_VERSION
198+
199+
This PR was automatically generated by the check-emulator-version workflow." \
200+
--base master
201+
202+

0 commit comments

Comments
 (0)