Skip to content

Commit 45cb743

Browse files
committed
ci: harden release workflows
1 parent 8bb4e92 commit 45cb743

4 files changed

Lines changed: 26 additions & 56 deletions

File tree

.github/workflows/check.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ on:
66
pull_request:
77
branches: [ master ]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
1114

1215
runs-on: ${{ matrix.os }}
1316

14-
env:
15-
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
16-
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
17-
1817
strategy:
1918
fail-fast: false
2019
matrix:
@@ -25,9 +24,9 @@ jobs:
2524
node-version: 20.x
2625

2726
steps:
28-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2928

30-
- uses: pnpm/action-setup@v3
29+
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3
3130
with:
3231
version: 9
3332
run_install: false
@@ -39,15 +38,13 @@ jobs:
3938
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
4039
4140
- name: Setup pnpm cache
42-
uses: actions/cache@v4
41+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
4342
with:
4443
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
4544
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('./pnpm-lock.yaml') }}
46-
restore-keys: |
47-
${{ runner.os }}-pnpm-store-
4845

4946
- name: Use Node.js ${{ matrix.node-version }}
50-
uses: actions/setup-node@v4
47+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
5148
with:
5249
node-version: ${{ matrix.node-version }}
5350

.github/workflows/main.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,21 @@ on:
55
pull_request:
66
types: [opened, edited, reopened, ready_for_review, synchronize]
77

8+
permissions:
9+
contents: read
10+
issues: write
11+
pull-requests: write
12+
813
jobs:
914
labeler:
1015
runs-on: ubuntu-latest
1116
name: label issues and pull requests
1217
steps:
1318
- name: check-out-repository
14-
uses: actions/checkout@v4
19+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
1520

1621
- name: labeler
17-
uses: jayu/super-labeler-action@develop
22+
uses: jayu/super-labeler-action@e0d24c761fc20458dafd9f3951698e94b1822657 # develop
1823
env:
1924
ACTIONS_STEP_DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG }}
2025
with:

.github/workflows/release.yml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,17 @@ jobs:
1717
name: Release
1818
runs-on: ubuntu-latest
1919

20-
env:
21-
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
22-
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
23-
2420
steps:
2521
- name: Checkout Repo
26-
uses: actions/checkout@v4
22+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2723

28-
- uses: pnpm/action-setup@v3
24+
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3
2925
with:
3026
version: 9
3127
run_install: false
3228

33-
- name: Get pnpm store directory
34-
id: pnpm-cache
35-
shell: bash
36-
run: |
37-
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
38-
39-
- name: Setup pnpm cache
40-
uses: actions/cache@v4
41-
with:
42-
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
43-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('./pnpm-lock.yaml') }}
44-
restore-keys: |
45-
${{ runner.os }}-pnpm-store-
46-
4729
- name: Setup Node.js 20.x
48-
uses: actions/setup-node@v4
30+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
4931
with:
5032
node-version: 20.x
5133
registry-url: 'https://registry.npmjs.org'
@@ -58,7 +40,7 @@ jobs:
5840

5941
- name: Create Release Pull Request or Publish to npm
6042
id: changesets
61-
uses: changesets/action@v1
43+
uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1
6244
with:
6345
publish: pnpm run release
6446
env:

.github/workflows/site-deploy.yml

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,32 @@ on:
33
push:
44
branches:
55
- master
6+
7+
permissions:
8+
contents: write
9+
610
jobs:
711
build-and-deploy:
812
runs-on: ubuntu-latest
913

10-
env:
11-
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
12-
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
13-
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
1616

17-
- uses: pnpm/action-setup@v3
17+
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3
1818
with:
1919
version: 9
2020
run_install: false
2121

22-
- name: Get pnpm store directory
23-
id: pnpm-cache
24-
shell: bash
25-
run: |
26-
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
27-
28-
- name: Setup pnpm cache
29-
uses: actions/cache@v4
30-
with:
31-
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
32-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('./pnpm-lock.yaml') }}
33-
restore-keys: |
34-
${{ runner.os }}-pnpm-store-
35-
3622
- name: Use Node.js 20.x
37-
uses: actions/setup-node@v4
23+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
3824
with:
3925
node-version: 20.x
4026

4127
- name: Install and prepare
4228
run: pnpm install --frozen-lockfile --strict-peer-dependencies
4329

4430
- name: Deploy 🚀
45-
uses: JamesIves/github-pages-deploy-action@3.7.1
31+
uses: JamesIves/github-pages-deploy-action@132898c54c57c7cc6b80eb3a89968de8fc283505 # 3.7.1
4632
with:
4733
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4834
BRANCH: gh-pages

0 commit comments

Comments
 (0)