Skip to content

Commit 90771c4

Browse files
authored
ci: pin SHA checksums of actions, disable cache in docs & package deploy workflows (#156)
1 parent 1dafa80 commit 90771c4

12 files changed

Lines changed: 51 additions & 28 deletions

.github/actions/setup/action.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
name: Setup
22
description: Setup Node.js and install dependencies
33

4+
inputs:
5+
enable-cache:
6+
description: When true, enable Yarn dependency caching in actions/setup-node
7+
required: true
8+
type: boolean
9+
410
runs:
511
using: composite
612
steps:
713
- name: Setup Node.js
8-
uses: actions/setup-node@v5
14+
if: ${{ inputs.enable-cache }}
15+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
16+
with:
17+
cache: yarn
18+
node-version: 24
19+
20+
- name: Setup Node.js
21+
if: ${{ !inputs.enable-cache }}
22+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
923
with:
10-
cache: 'yarn'
1124
node-version: 24
1225

1326
- name: Install dependencies

.github/workflows/deploy-docs.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v5
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2525
with:
2626
fetch-depth: 0 # Not needed if lastUpdated is not enabled
2727
- name: Setup
2828
uses: ./.github/actions/setup
29+
with:
30+
enable-cache: false
2931

3032
- name: Setup Pages
31-
uses: actions/configure-pages@v5
33+
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
3234

3335
- name: Install dependencies
3436
working-directory: docs
@@ -40,7 +42,7 @@ jobs:
4042
yarn run build
4143
4244
- name: Upload artifact
43-
uses: actions/upload-pages-artifact@v3
45+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
4446
with:
4547
path: docs/doc_build
4648

@@ -55,4 +57,4 @@ jobs:
5557
steps:
5658
- name: Deploy to GitHub Pages
5759
id: deployment
58-
uses: actions/deploy-pages@v4
60+
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0

.github/workflows/lint-android.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout Repo
18-
uses: actions/checkout@v5
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1919
with:
2020
fetch-depth: 0
2121

2222
- name: Set Java version
23-
uses: actions/setup-java@v4
23+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
2424
with:
2525
distribution: 'temurin'
2626
java-version: '17'

.github/workflows/lint-docs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout Repo
18-
uses: actions/checkout@v5
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1919
with:
2020
fetch-depth: 0
2121

2222
- name: Setup
2323
uses: ./.github/actions/setup
24+
with:
25+
enable-cache: true
2426

2527
- name: Run linter
2628
run: yarn lint:docs

.github/workflows/lint-objc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout Repo
18-
uses: actions/checkout@v5
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1919
with:
2020
fetch-depth: 0
2121

2222
- name: Lint ObjC with clang-format
23-
uses: RafikFarhad/clang-format-github-action@v4
23+
uses: RafikFarhad/clang-format-github-action@27cc2adf6e733d30c8ce3ca3944f3b2c7b13e1f5 # v6.0.1
2424
with:
2525
sources: "packages/react-native-legal/**/*.h,packages/react-native-legal/**/*.m,packages/react-native-legal/**/*.mm"
2626
style: file

.github/workflows/lint-swift.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ jobs:
1515
runs-on: macos-15
1616
steps:
1717
- name: Checkout Repo
18-
uses: actions/checkout@v5
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1919
with:
2020
fetch-depth: 0
2121

2222
- name: Install Swift
23-
uses: swift-actions/setup-swift@v2
23+
uses: swift-actions/setup-swift@7ca6abe6b3b0e8b5421b88be48feee39cbf52c6a # v2.4.0
2424
with:
2525
swift-version: '6'
2626

.github/workflows/lint-ts.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout Repo
26-
uses: actions/checkout@v5
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2727
with:
2828
fetch-depth: 0
2929

3030
- name: Setup
3131
uses: ./.github/actions/setup
32+
with:
33+
enable-cache: true
3234

3335
- name: Run linter
3436
run: yarn lint:js

.github/workflows/release.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,18 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout Repo
21-
uses: actions/checkout@v5
21+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2222
with:
2323
fetch-depth: 0
24-
25-
- name: Setup Node.js
26-
uses: actions/setup-node@v5
24+
25+
- name: Setup
26+
uses: ./.github/actions/setup
2727
with:
28-
node-version: 24
29-
cache: yarn
30-
31-
- name: Install Dependencies
32-
run: yarn install --immutable
28+
enable-cache: false
3329

3430
- name: Create Release Pull Request or Publish to npm
3531
id: changesets
36-
uses: changesets/action@v1.7.0
32+
uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0
3733
with:
3834
version: yarn run version
3935
commit: "chore: version packages"

.github/workflows/test-e2e-android.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ jobs:
4444
sudo udevadm trigger --name-match=kvm
4545
4646
- name: Checkout Repo
47-
uses: actions/checkout@v5
47+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4848
with:
4949
fetch-depth: 0
5050

5151
- name: Setup
5252
uses: ./.github/actions/setup
53+
with:
54+
enable-cache: true
5355

5456
- name: Install Maestro
5557
uses: ./.github/actions/installMaestro

.github/workflows/test-e2e-ios.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@ jobs:
3838
simulator: ['iPhone 16 Pro (18.5)']
3939
steps:
4040
- name: Checkout Repo
41-
uses: actions/checkout@v5
41+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4242
with:
4343
fetch-depth: 0
4444

4545
- name: Setup
4646
uses: ./.github/actions/setup
47+
with:
48+
enable-cache: true
4749

4850
- name: Install Maestro
4951
uses: ./.github/actions/installMaestro

0 commit comments

Comments
 (0)