-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (41 loc) · 1.46 KB
/
update_tdk_version.yml
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Update TDK version
on:
repository_dispatch:
types: [update-tdk-version]
jobs:
update-tdk-version:
name: Update TDK image version
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ github.event.client_payload.version }}
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.TDK_GOVERNOR_RELEASE_APP_ID }}
private-key: ${{ secrets.TDK_GOVERNOR_RELEASE_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
- name: Update image version
env:
IMAGE_VERSION: |-
synthesizedio/synthesized-tdk-cli:v${{ env.RELEASE_VERSION }}
run: |
yq -i '.services.tdk.image = strenv(IMAGE_VERSION)' \
./parent-compose.yml
- name: Push and commit changes
run: |
branch="update-release-version-v${RELEASE_VERSION}"
git config user.name "github_actions"
git checkout -b $branch
git add parent-compose.yml
git commit -m "Update image version to v${RELEASE_VERSION}"
git push origin $branch
- name: Create PR
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
pr=$(gh pr create --base main \
--head "update-release-version-v${RELEASE_VERSION}" \
--title "Update image version to v${RELEASE_VERSION}" \
--body 'Created by Github action')
gh pr merge $pr --auto --squash