@@ -27,19 +27,19 @@ jobs:
2727 steps :
2828 - name : Generate GitHub App token
2929 id : generate_token
30- 30+ uses : tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
3131 with :
3232 app_id : ${{ secrets.BOT_APP_ID }}
3333 private_key : ${{ secrets.BOT_PRIVATE_KEY }}
3434
3535 - name : Checkout Repo
36- uses : actions/checkout@v4
36+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3737
3838 - name : Setup PNPM
39- uses : pnpm/action-setup@v3
39+ uses : pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
4040
4141 - name : Setup Node
42- uses : actions/setup-node@v4
42+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4343 with :
4444 node-version : ${{ env.NODE_VERSION }}
4545 cache : " pnpm"
@@ -48,23 +48,33 @@ jobs:
4848 run : pnpm i
4949
5050 - name : Create Release Pull Request
51+ uses : changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3
5152 id : changesets
52- uses : changesets/action@v1
5353 with :
54- commit : " [ci] release"
55- title : " [ci] release"
54+ version : pnpm run version
55+ commit : " ci: release"
56+ title : " ci: release [skip netlify]"
5657 env :
57- GITHUB_TOKEN : ${{ steps.generate_token.outputs.token }}
58+ GITHUB_TOKEN : ${{ steps.generate_token.outputs.token}}
5859 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
5960
61+ - name : Get published version
62+ if : steps.changesets.outputs.hasChangesets == 'true'
63+ run : |
64+ git checkout changeset-release/main
65+ VERSION=$(node -p "require('./app/package.json').version")
66+ NAME=$(node -p "require('./app/package.json').name")
67+ git commit --amend -m "ci: release $NAME v$VERSION" --no-edit
68+ git push origin changeset-release/main:changeset-release/main --force
69+
6070 image-tag :
6171 name : Image Tag
6272 runs-on : ubuntu-latest
6373 outputs :
6474 IMAGE_TAG : ${{ env.IMAGE_TAG }}
6575 steps :
6676 - name : Check out the repo
67- uses : actions/checkout@v4
77+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6878
6979 - name : Read version from package.json
7080 id : get_version
7989 needs.changesets.outputs.hasChangesets == 'false' &&
8090 (
8191 contains(github.event.head_commit.message, 'deploy') ||
82- contains(github.event.head_commit.message, '[ci] release')
92+ contains(github.event.head_commit.message, 'release')
8393 )
8494 ) ||
8595 github.event_name == 'workflow_dispatch'
@@ -88,27 +98,27 @@ jobs:
8898 contents : write
8999 steps :
90100 - name : Check out the repo
91- uses : actions/checkout@v4
101+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
92102 with :
93103 fetch-depth : 0
94104
95105 - name : Set up Docker Buildx
96- uses : docker/setup-buildx-action@v3
106+ uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
97107
98108 - name : Log in to Docker Hub
99- uses : docker/login-action@v3
109+ uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
100110 with :
101111 username : ${{ secrets.DOCKER_USERNAME }}
102112 password : ${{ secrets.DOCKER_PASSWORD }}
103113
104114 - name : Extract metadata (tags, labels) for Docker
105115 id : meta
106- uses : docker/metadata-action@v5
116+ uses : docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
107117 with :
108118 images : ${{ env.REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}
109119
110120 - name : Build and push Docker image
111- uses : docker/build-push-action@v6
121+ uses : docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0 # v6.17.0
112122 with :
113123 context : ./app
114124 push : true
@@ -121,7 +131,7 @@ jobs:
121131 run : |
122132 yq eval '.spec.template.spec.containers[0].image = "${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:${{ needs.image-tag.outputs.IMAGE_TAG }}"' -i manifest/deployment.yaml
123133
124- - uses : stefanzweifel/git-auto-commit-action@v4
134+ - uses : stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 # v5.2.0
125135 with :
126136 commit_message : update deployment.json container image (automated)
127137
@@ -133,10 +143,10 @@ jobs:
133143 contents : write
134144 steps :
135145 - name : Check out the repo
136- uses : actions/checkout@v4
146+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
137147
138148 - id : extract-changelog
139- 149+ uses : sean0x42/markdown-extract@7b185cbe85263116bbf741e739e7198ba86465dc # v2.1.0
140150 with :
141151 file : app/CHANGELOG.md
142152 pattern : ${{ needs.image-tag.outputs.IMAGE_TAG }}
@@ -162,7 +172,7 @@ jobs:
162172 if : env.RELEASE_SKIPPED == 'false'
163173 env :
164174 DISCORD_WEBHOOK : ${{ secrets.DISCORD_WEBHOOK_URL }}
165- 175+ uses : Ilshidur/action-discord@0c4b27844ba47cb1c7bee539c8eead5284ce9fa9 # 0.3.2
166176 with :
167177 args : |
168178 # ${{ env.IMAGE_NAME }}@${{ needs.image-tag.outputs.IMAGE_TAG }}
0 commit comments