Skip to content

Commit 2eb5e88

Browse files
ci: utilize reearth/actions/remove-cloud-run-tag (#1643)
1 parent bfa84e5 commit 2eb5e88

20 files changed

+94
-133
lines changed

.github/workflows/build_prepare.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
name: ${{ steps.info.outputs.name }}
2121
steps:
2222
- name: checkout
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2424
- name: Fetch tags
2525
run: git fetch --prune --unshallow --tags
2626
- name: Get info

.github/workflows/build_release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ jobs:
2727
ARTIFACTS: server/dist/reearth_*.*
2828
steps:
2929
- name: Checkout
30-
uses: actions/checkout@v4
30+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3131
with:
3232
fetch-depth: 0
3333
- name: Set up Go
34-
uses: actions/setup-go@v5
34+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
3535
with:
3636
go-version: "1.23.5"
3737
- name: Run GoReleaser
38-
uses: goreleaser/goreleaser-action@v6
38+
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
3939
# TODO: fix error=archive named dist/reearth_0.0.0-SNAPSHOT-xxxxxxxx.tar.gz already exists. Check your archive name template
4040
with:
4141
distribution: goreleaser
@@ -51,7 +51,7 @@ jobs:
5151
run: ls -l server/dist
5252
- name: Release nightly/rc
5353
if: ${{ inputs.name != '' }}
54-
uses: ncipollo/release-action@v1
54+
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
5555
with:
5656
allowUpdates: true
5757
artifacts: ${{ env.ARTIFACTS }}
@@ -62,13 +62,13 @@ jobs:
6262
prerelease: true
6363
- name: Download latest changelog
6464
if: ${{ inputs.new_tag != '' }}
65-
uses: dawidd6/action-download-artifact@v2
65+
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0
6666
with:
6767
workflow: release.yml
6868
name: changelog-${{ inputs.new_tag }}
6969
- name: Create GitHub release
7070
if: ${{ inputs.new_tag != '' }}
71-
uses: ncipollo/release-action@v1
71+
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
7272
with:
7373
allowUpdates: true
7474
artifacts: ${{ env.ARTIFACTS }}

.github/workflows/build_server.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ jobs:
3030
working-directory: server
3131
steps:
3232
- name: Checkout
33-
uses: actions/checkout@v4
34-
- uses: actions/create-github-app-token@v1
33+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
- uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0
3535
id: app-token
3636
with:
3737
app-id: ${{ vars.GH_APP_ID }}
3838
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
3939
- name: Set up QEMU
40-
uses: docker/setup-qemu-action@v3
40+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
4141
- name: Set up Docker Buildx
42-
uses: docker/setup-buildx-action@v3
42+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
4343
- name: Login to DockerHub
44-
uses: docker/login-action@v2
44+
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
4545
with:
4646
username: ${{ secrets.DOCKERHUB_USERNAME }}
4747
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -81,7 +81,7 @@ jobs:
8181
- name: Extract reearth/web
8282
run: tar -xvf reearth-web.tar.gz; mv reearth-web web; ls
8383
- name: Build and push docker image
84-
uses: docker/build-push-action@v6
84+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
8585
with:
8686
context: server
8787
platforms: ${{ steps.options.outputs.platforms }}

.github/workflows/build_web.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ jobs:
3434
working-directory: web
3535
steps:
3636
- name: Checkout
37-
uses: actions/checkout@v4
37+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3838
- name: Set up QEMU
39-
uses: docker/setup-qemu-action@v3
39+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
4040
- name: Set up Docker Buildx
41-
uses: docker/setup-buildx-action@v3
41+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
4242
- name: Login to DockerHub
43-
uses: docker/login-action@v3
43+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
4444
with:
4545
username: ${{ secrets.DOCKERHUB_USERNAME }}
4646
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -69,7 +69,7 @@ jobs:
6969
echo "::set-output name=version::$VERSION"
7070
echo "::set-output name=tags::$TAGS"
7171
- name: Build and push docker image
72-
uses: docker/build-push-action@v6
72+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
7373
with:
7474
context: web
7575
platforms: ${{ steps.options.outputs.platforms }}
@@ -88,8 +88,8 @@ jobs:
8888
env:
8989
NODE_OPTIONS: "--max-old-space-size=8192"
9090
steps:
91-
- uses: actions/checkout@v4
92-
- uses: actions/setup-node@v4
91+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
92+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
9393
with:
9494
node-version: lts/*
9595
- name: Install Yarn
@@ -99,7 +99,7 @@ jobs:
9999
- name: Get yarn cache directory path
100100
id: yarn-cache-dir-path
101101
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
102-
- uses: actions/cache@v3
102+
- uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3.4.3
103103
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
104104
with:
105105
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -112,7 +112,7 @@ jobs:
112112
run: yarn build
113113
- name: Pack
114114
run: mv dist reearth-web && tar -zcvf reearth-web.tar.gz reearth-web
115-
- uses: actions/upload-artifact@v4
115+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
116116
with:
117117
name: reearth-web
118118
path: web/reearth-web.tar.gz
@@ -124,18 +124,18 @@ jobs:
124124
env:
125125
ARTIFACT: reearth-web_${{ inputs.name }}.tar.gz
126126
steps:
127-
- uses: actions/create-github-app-token@v1
127+
- uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0
128128
id: app-token
129129
with:
130130
app-id: ${{ vars.GH_APP_ID }}
131131
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
132-
- uses: actions/download-artifact@v4
132+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
133133
with:
134134
name: reearth-web
135135
- name: Rename artifact
136136
run: mv reearth-web.tar.gz $ARTIFACT
137137
- name: Release
138-
uses: ncipollo/release-action@v1
138+
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
139139
with:
140140
allowUpdates: true
141141
artifacts: ${{ env.ARTIFACT }}
@@ -161,12 +161,12 @@ jobs:
161161
- name: Rename artifact
162162
run: mv reearth-web_rc.tar.gz $ARTIFACT
163163
- name: Download latest changelog
164-
uses: dawidd6/action-download-artifact@v8
164+
uses: dawidd6/action-download-artifact@20319c5641d495c8a52e688b7dc5fada6c3a9fbc # v8
165165
with:
166166
workflow: release.yml
167167
name: changelog-${{ inputs.new_tag }}
168168
- name: Create GitHub release
169-
uses: ncipollo/release-action@v1
169+
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
170170
with:
171171
allowUpdates: true
172172
artifacts: ${{ env.ARTIFACT }}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
web: ${{ steps.web.outputs.any_modified }}
1212
server: ${{ steps.server.outputs.any_modified }}
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1515
with:
1616
fetch-depth: 0
1717
- name: changed files for web

.github/workflows/ci_server.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
if: github.event_name != 'push' || !startsWith(github.event.head_commit.message, 'v')
1111
steps:
1212
- name: checkout
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1414
- name: set up
15-
uses: actions/setup-go@v5
15+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
1616
with:
1717
go-version: ${{ env.GO_VERSION }}
1818
cache: false
1919
- name: golangci-lint
20-
uses: golangci/golangci-lint-action@v6
20+
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
2121
with:
2222
version: v1.63.4
2323
args: --timeout=10m
@@ -46,9 +46,9 @@ jobs:
4646
fsouza/fake-gcs-server:1.52.1 \
4747
-scheme http
4848
- name: checkout
49-
uses: actions/checkout@v4
49+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5050
- name: set up
51-
uses: actions/setup-go@v5
51+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
5252
with:
5353
go-version: ${{ env.GO_VERSION }}
5454
cache-dependency-path: server/go.sum
@@ -58,7 +58,7 @@ jobs:
5858
REEARTH_DB: mongodb://localhost
5959
working-directory: server
6060
- name: Send coverage report
61-
uses: codecov/codecov-action@v5
61+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
6262
with:
6363
token: ${{ secrets.CODECOV_TOKEN }}
6464
flags: server

.github/workflows/ci_web.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
run:
1616
working-directory: web
1717
steps:
18-
- uses: actions/checkout@v4
19-
- uses: actions/setup-node@v4
18+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2020
with:
2121
node-version: lts/*
2222
- name: Install Yarn
@@ -26,7 +26,7 @@ jobs:
2626
- name: Get yarn cache directory path
2727
id: yarn-cache-dir-path
2828
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
29-
- uses: actions/cache@v4
29+
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
3030
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
3131
with:
3232
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -42,7 +42,7 @@ jobs:
4242
- name: Check
4343
run: yarn run coverage
4444
- name: Send coverage report
45-
uses: codecov/codecov-action@v5
45+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
4646
with:
4747
token: ${{ secrets.CODECOV_TOKEN }}
4848
flags: web,web-beta,web-classic,web-utils

.github/workflows/cleanup-cloudrun-tag.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/cleanup-pr-revision.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
show-github-event-info:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Debug event info
13+
- name: Print event information
1414
run: |
1515
echo "Event name: ${{ github.event_name }}"
1616
echo "Event action: ${{ github.event.action }}"
@@ -20,16 +20,26 @@ jobs:
2020
2121
cleanup-pr-revision-server:
2222
needs: [show-github-event-info]
23-
uses: ./.github/workflows/cleanup-cloudrun-tag.yml
24-
with:
25-
service: reearth-visualizer-api
26-
tag: pr-${{ github.event.pull_request.number }}
27-
secrets: inherit
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Remove Cloud Run Tag
26+
uses: reearth/actions/remove-cloud-run-tag@1ae08d22fd3c8a91f1346329f46b26327968f401 # main
27+
with:
28+
region: ${{ secrets.GC_REGION }}
29+
service: reearth-visualizer-server
30+
service_account: ${{ secrets.GC_SA_EMAIL }}
31+
tag: pr-${{ github.event.pull_request.number }}
32+
workload_identity_provider: ${{ secrets.GC_WORKLOAD_IDENTITY_PROVIDER }}
2833

2934
cleanup-pr-revision-web:
3035
needs: [show-github-event-info]
31-
uses: ./.github/workflows/cleanup-cloudrun-tag.yml
32-
with:
33-
service: reearth-visualizer-web
34-
tag: pr-${{ github.event.pull_request.number }}
35-
secrets: inherit
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Remove Cloud Run Tag
39+
uses: reearth/actions/remove-cloud-run-tag@1ae08d22fd3c8a91f1346329f46b26327968f401 # main
40+
with:
41+
region: ${{ secrets.GC_REGION }}
42+
service: reearth-visualizer-web
43+
service_account: ${{ secrets.GC_SA_EMAIL }}
44+
tag: pr-${{ github.event.pull_request.number }}
45+
workload_identity_provider: ${{ secrets.GC_WORKLOAD_IDENTITY_PROVIDER }}

.github/workflows/deploy_server_nightly.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
contents: read
1414
id-token: write
1515
steps:
16-
- uses: actions/checkout@v4
17-
- uses: google-github-actions/auth@v2
16+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
- uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f # v2.1.7
1818
with:
1919
service_account: ${{ secrets.GC_SA_EMAIL }}
2020
workload_identity_provider: ${{ secrets.GC_WORKLOAD_IDENTITY_PROVIDER }}
2121
- name: Set up Cloud SDK
22-
uses: google-github-actions/setup-gcloud@v2
22+
uses: google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a # v2.1.2
2323
- name: Configure docker
2424
run: gcloud auth configure-docker us-central1-docker.pkg.dev --quiet
2525
- name: docker push

0 commit comments

Comments
 (0)