@@ -26,44 +26,44 @@ jobs:
2626 packages : write
2727 if : github.event_name == 'release' || (github.event_name == 'pull_request' && github.event.action != 'closed' && github.repository == github.event.pull_request.head.repo.full_name)
2828 steps :
29- - uses : actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
29+ - uses : actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
3030 with :
3131 fetch-depth : 0
3232 - name : Set .env
3333 run : cp .env.example .env
3434 - name : Login to GitHub Container Registry
35- uses : docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1 .0
35+ uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3 .0
3636 with :
3737 registry : ghcr.io
3838 username : ${{ github.actor }}
3939 password : ${{ secrets.GITHUB_TOKEN }}
4040 - name : Set up QEMU
41- uses : docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0 .0
41+ uses : docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2 .0
4242 - name : Set up Docker Buildx
4343 id : buildx
44- uses : docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
44+ uses : docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
4545 - run : echo "TAG_NAME=${HEAD_REF//\//-}" >> "$GITHUB_ENV"
4646 env :
4747 HEAD_REF : ${{github.head_ref}}
4848 if : ${{ github.event_name == 'pull_request' }}
4949 - run : echo 'TAG_NAME=${{ github.event.release.tag_name }}' >> "$GITHUB_ENV"
5050 if : ${{ github.event_name == 'release' }}
5151 - name : Build and push (build)
52- uses : docker/bake-action@017aa056d6bfc9797de5a5dd354a209dc07b490e # v4.3 .0
52+ uses : docker/bake-action@e626c7390c9f95508a135a89e65ec698e061fb2a # v5.8 .0
5353 env :
5454 DOCKER_CONTENT_TRUST : 1
5555 with :
5656 push : true
5757 files : build.docker-compose.yml
5858 - name : Build and push (main)
59- uses : docker/bake-action@017aa056d6bfc9797de5a5dd354a209dc07b490e # v4.3 .0
59+ uses : docker/bake-action@e626c7390c9f95508a135a89e65ec698e061fb2a # v5.8 .0
6060 env :
6161 DOCKER_CONTENT_TRUST : 1
6262 with :
6363 push : true
6464 files : docker-compose.yml
6565 - name : Build and push (dev)
66- uses : docker/bake-action@017aa056d6bfc9797de5a5dd354a209dc07b490e # v4.3 .0
66+ uses : docker/bake-action@e626c7390c9f95508a135a89e65ec698e061fb2a # v5.8 .0
6767 env :
6868 DOCKER_CONTENT_TRUST : 1
6969 with :
@@ -72,23 +72,23 @@ jobs:
7272 - run : echo 'TAG_NAME=latest' >> "$GITHUB_ENV"
7373 if : ${{ github.event_name == 'release' }}
7474 - name : Build and push (build) (latest)
75- uses : docker/bake-action@017aa056d6bfc9797de5a5dd354a209dc07b490e # v4.3 .0
75+ uses : docker/bake-action@e626c7390c9f95508a135a89e65ec698e061fb2a # v5.8 .0
7676 if : ${{ github.event_name == 'release' }}
7777 env :
7878 DOCKER_CONTENT_TRUST : 1
7979 with :
8080 push : true
8181 files : build.docker-compose.yml
8282 - name : Build and push (main) (latest)
83- uses : docker/bake-action@017aa056d6bfc9797de5a5dd354a209dc07b490e # v4.3 .0
83+ uses : docker/bake-action@e626c7390c9f95508a135a89e65ec698e061fb2a # v5.8 .0
8484 if : ${{ github.event_name == 'release' }}
8585 env :
8686 DOCKER_CONTENT_TRUST : 1
8787 with :
8888 push : true
8989 files : docker-compose.yml
9090 - name : Build and push (dev) (latest)
91- uses : docker/bake-action@017aa056d6bfc9797de5a5dd354a209dc07b490e # v4.3 .0
91+ uses : docker/bake-action@e626c7390c9f95508a135a89e65ec698e061fb2a # v5.8 .0
9292 if : ${{ github.event_name == 'release' }}
9393 env :
9494 DOCKER_CONTENT_TRUST : 1
@@ -111,7 +111,7 @@ jobs:
111111 needs : deploy_docker_image
112112 if : always() && (needs.deploy_docker_image.result == 'success' || (github.event_name == 'pull_request' && github.event.action == 'closed'))
113113 steps :
114- - uses : actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
114+ - uses : actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
115115 if : github.event_name != 'pull_request' || github.event.action != 'closed'
116116 with :
117117 fetch-depth : 0
@@ -122,20 +122,75 @@ jobs:
122122 run : bash "${GITHUB_WORKSPACE}/scripts/deploy_hato_bot/update_version_python_version/get_python_version.sh"
123123 env :
124124 HEAD_REF : ${{github.head_ref || github.event.release.tag_name}}
125- - uses : dev-hato/actions-diff-pr-management@128afc4203b4e391e03868be91c987b2ddba7ea5 # v1.1.12
125+ - uses : dev-hato/actions-diff-pr-management@7cc8ab103917849f6995064afae9f4cbcfd009ae # v1.1.13
126126 with :
127127 github-token : ${{secrets.GITHUB_TOKEN}}
128128 branch-name-prefix : fix-version-python-version
129129 pr-title-prefix : .python-versionを直してあげたよ!
130+ pr-update-version :
131+ runs-on : ubuntu-latest
132+ needs : deploy_docker_image
133+ if : always() && (needs.deploy_docker_image.result == 'success' || (github.event_name == 'pull_request' && github.event.action == 'closed'))
134+ permissions :
135+ contents : write
136+ pull-requests : write
137+ steps :
138+ - uses : actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
139+ if : github.event_name != 'pull_request' || github.event.action != 'closed'
140+ with :
141+ fetch-depth : 0
142+ ref : ${{ github.event.pull_request.head.sha }}
143+ - uses : actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
144+ if : github.event_name != 'pull_request' || github.event.action != 'closed'
145+ with :
146+ cache : npm
147+ node-version-file : package.json
148+ - name : Get npm version
149+ id : get_npm_version
150+ if : github.event_name != 'pull_request' || github.event.action != 'closed'
151+ run : bash "${GITHUB_WORKSPACE}/scripts/deploy_hato_bot/pr_update_version/get_npm_version.sh"
152+ env :
153+ HEAD_REF : ${{github.head_ref || github.event.release.tag_name}}
154+ - uses : dev-hato/actions-diff-pr-management@7cc8ab103917849f6995064afae9f4cbcfd009ae # v1.1.13
155+ with :
156+ github-token : ${{secrets.GITHUB_TOKEN}}
157+ branch-name-prefix : fix-version
158+ pr-title-prefix : nodeをアップデートしてあげたよ!
159+ # package.jsonに差分があれば、package.jsonからpackage-lock.jsonを作り出す
160+ pr-check-npm :
161+ runs-on : ubuntu-latest
162+ needs : pr-update-version
163+ steps :
164+ - uses : actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
165+ if : github.event_name != 'pull_request' || github.event.action != 'closed'
166+ with :
167+ # ここでsubmodule持ってくるとdetached headにcommitして死ぬ
168+ # submodule: 'recursive'
169+ fetch-depth : 0
170+ ref : ${{ github.event.pull_request.head.sha }}
171+ - name : Set up Node.js
172+ uses : actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
173+ if : github.event_name != 'pull_request' || github.event.action != 'closed'
174+ with :
175+ cache : npm
176+ node-version-file : package.json
177+ - name : Install dependencies
178+ if : github.event_name != 'pull_request' || github.event.action != 'closed'
179+ run : bash "${GITHUB_WORKSPACE}/scripts/deploy_hato_bot/npm_install.sh"
180+ - uses : dev-hato/actions-diff-pr-management@7cc8ab103917849f6995064afae9f4cbcfd009ae # v1.1.13
181+ with :
182+ github-token : ${{secrets.GITHUB_TOKEN}}
183+ branch-name-prefix : npm
184+ pr-title-prefix : package.jsonやpackage-lock.jsonが更新されたので直してあげたよ!
130185 update-dockle :
131186 runs-on : ubuntu-latest
132187 steps :
133- - uses : actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
188+ - uses : actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
134189 if : github.event_name != 'pull_request' || github.event.action != 'closed'
135190 with :
136191 fetch-depth : 0
137192 ref : ${{ github.event.pull_request.head.sha }}
138- - uses : dev-hato/actions-update-dockle@c92b0e505cc4ed6dc1b4c2c6851193d02ce5fcba # v0.0.81
193+ - uses : dev-hato/actions-update-dockle@c826f84c72bdedef7eb84c90d4370405b984f0dc # v0.0.97
139194 with :
140195 github-token : ${{secrets.GITHUB_TOKEN}}
141196 dockle :
@@ -147,7 +202,7 @@ jobs:
147202 DOCKER_CONTENT_TRUST : 1
148203 REPOSITORY : ${{github.repository}}
149204 steps :
150- - uses : actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
205+ - uses : actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
151206 - run : bash "${GITHUB_WORKSPACE}/scripts/deploy_hato_bot/dockle/run_dockle.sh"
152207 env :
153208 HEAD_REF : ${{github.head_ref || github.event.release.tag_name}}
@@ -156,12 +211,13 @@ jobs:
156211 if : always()
157212 needs :
158213 - update-version-python-version
214+ - pr-check-npm
159215 - update-dockle
160216 - dockle
161217 steps :
162- - if : needs.update-dockle.result == 'success' && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name) || (needs.update-version-python-version.result == 'success' && (github.event.action == 'closed' || needs.dockle.result == 'success')))
218+ - if : needs.update-dockle.result == 'success' && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name) || (needs.update-version-python-version.result == 'success' && (github.event.action == 'closed' || ( needs.pr-check-npm.result == 'success' && needs. dockle.result == 'success') )))
163219 run : exit 0
164- - if : ${{ !(needs.update-dockle.result == 'success' && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name) || (needs.update-version-python-version.result == 'success' && (github.event.action == 'closed' || needs.dockle.result == 'success')))) }}
220+ - if : ${{ !(needs.update-dockle.result == 'success' && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name) || (needs.update-version-python-version.result == 'success' && (github.event.action == 'closed' || ( needs.pr-check-npm.result == 'success' && needs. dockle.result == 'success') )))) }}
165221 run : exit 1
166222concurrency :
167223 group : ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
0 commit comments