forked from GoogleCloudPlatform/cloud-sql-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (23 loc) · 900 Bytes
/
update-versions.yml
File metadata and controls
30 lines (23 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: update-version
on:
pull_request:
branches: ['master']
paths:
- 'version.txt'
jobs:
update-version-in-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.head_ref }}
- if: github.actor == 'github-actions[bot]'
name: find-and-replace-version
run: |
VERSION=$(cat version.txt)
sed -i -r 's/(var versionString = ")[0-9]+.[0-9]+.[0-9]+(-dev)?/\1'"$VERSION"'/' cmd/cloud_sql_proxy/cloud_sql_proxy.go
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add cmd/cloud_sql_proxy/cloud_sql_proxy.go
git commit -m "Update version"
git push origin ${{ github.head_ref }}