|
1 | | -name: Check Emulator Version |
| 1 | +name: Bump Emulator Version |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | schedule: |
|
8 | 8 | workflow_dispatch: |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - check-emulator-version: |
| 11 | + bump-emulator-version: |
12 | 12 | name: Check for new emulator version |
13 | 13 | runs-on: ubuntu-latest |
14 | 14 | permissions: |
|
17 | 17 | steps: |
18 | 18 | - name: Check out the repo |
19 | 19 | uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + ref: master |
20 | 22 |
|
21 | 23 | - name: Get current version and check for newer versions |
22 | 24 | id: version-check |
@@ -171,14 +173,30 @@ jobs: |
171 | 173 |
|
172 | 174 | - name: Create Pull Request |
173 | 175 | 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