Skip to content

Commit 2a85c9b

Browse files
authored
chore: refer to commit sha of actions instead of tags (#13625)
Instead of using tags to refer to a version of an action (e.g. `actions/checkout@v3`), we now use its commit sha. The problem with tags is that they are mutable and can be changed to point to a different commit. This opens a vector for supply chain attacks. For one action, the user account had been renamed from 'nick-invision' to 'nick-fields' which caused a redirect when resolving the action with the old username. This is potentially dangerous when the account name gets claimed again, so we now use the new user name to refer to the action. Increases the version of the create-pull-request action from v4 to v6 to have matching versions of the action across workflows. Contributed on behalf of STMicroelectronics Signed-off-by: Olaf Lessenich <[email protected]>
1 parent 324457a commit 2a85c9b

11 files changed

+43
-43
lines changed

.github/workflows/ci-cd.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ jobs:
1818

1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
2222

2323
- name: Use Node.js 18.x
24-
uses: actions/setup-node@v3
24+
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
2525
with:
2626
node-version: 18.x
2727
registry-url: 'https://registry.npmjs.org'
2828

2929
- name: Use Python 3.11
30-
uses: actions/setup-python@v4
30+
uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa # v4.8.0
3131
with:
3232
python-version: '3.11'
3333

@@ -59,16 +59,16 @@ jobs:
5959

6060
steps:
6161
- name: Checkout
62-
uses: actions/checkout@v3
62+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
6363

6464
- name: Use Node.js ${{ matrix.node }}
65-
uses: actions/setup-node@v3
65+
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
6666
with:
6767
node-version: ${{ matrix.node }}
6868
registry-url: 'https://registry.npmjs.org'
6969

7070
- name: Use Python 3.11
71-
uses: actions/setup-python@v4
71+
uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa # v4.8.0
7272
with:
7373
python-version: '3.11'
7474

.github/workflows/license-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ jobs:
2828

2929
steps:
3030
- name: Checkout
31-
uses: actions/checkout@v3
31+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
3232
with:
3333
fetch-depth: 2
3434

3535
- name: Use Node.js ${{ matrix.node }}
36-
uses: actions/setup-node@v3
36+
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
3737
with:
3838
node-version: ${{ matrix.node }}
3939
registry-url: 'https://registry.npmjs.org'
4040

4141
- name: Use Java ${{ matrix.java }}
42-
uses: actions/setup-java@v3
42+
uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b # v3.9.0
4343
with:
4444
distribution: 'adopt'
4545
java-version: ${{ matrix.java }}

.github/workflows/native-dependencies.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ jobs:
1010
os: ['ubuntu-20.04', 'windows-latest', 'macos-latest']
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
1414

1515
# Update the node version here after every Electron upgrade
1616
- name: Use Node.js 18.17.0
17-
uses: actions/setup-node@v3
17+
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
1818
with:
1919
node-version: '18.17.0'
2020
registry-url: 'https://registry.npmjs.org'
2121

2222
- name: Use Python 3.11
23-
uses: actions/setup-python@v4
23+
uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa # v4.8.0
2424
with:
2525
python-version: '3.11'
2626

@@ -44,7 +44,7 @@ jobs:
4444
run: yarn zip:native:dependencies
4545

4646
- name: Upload Artifacts
47-
uses: actions/upload-artifact@v3
47+
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
4848
with:
4949
name: native-dependencies
5050
path: ./scripts/native-dependencies-*.zip

.github/workflows/performance-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ jobs:
1212

1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
1616

1717
- name: Use Node.js 18.x
18-
uses: actions/setup-node@v3
18+
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
1919
with:
2020
node-version: "18.x"
2121
registry-url: "https://registry.npmjs.org"
2222

2323
- name: Use Python 3.11
24-
uses: actions/setup-python@v4
24+
uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa # v4.8.0
2525
with:
2626
python-version: '3.11'
2727

@@ -44,7 +44,7 @@ jobs:
4444
run: xvfb-run yarn performance:startup:electron
4545

4646
- name: Analyze performance results
47-
uses: benchmark-action/github-action-benchmark@v1
47+
uses: benchmark-action/github-action-benchmark@fd31771ce86cc65eab85653da103f71ab1b4479c # v1.9.0
4848
with:
4949
name: Performance Benchmarks
5050
tool: "customSmallerIsBetter"

.github/workflows/playwright.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ jobs:
2020

2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
2424

2525
- name: Use Node.js "18.x"
26-
uses: actions/setup-node@v3
26+
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
2727
with:
2828
node-version: "18.x"
2929
registry-url: "https://registry.npmjs.org"
3030

3131
- name: Use Python 3.11
32-
uses: actions/setup-python@v4
32+
uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa # v4.8.0
3333
with:
3434
python-version: "3.11"
3535

.github/workflows/production-smoke-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ jobs:
1818

1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
2222

2323
- name: Use Node.js "18.x"
24-
uses: actions/setup-node@v3
24+
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
2525
with:
2626
node-version: "18.x"
2727
registry-url: "https://registry.npmjs.org"
2828

2929
- name: Use Python 3.11
30-
uses: actions/setup-python@v4
30+
uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa # v4.8.0
3131
with:
3232
python-version: "3.11"
3333

.github/workflows/publish-gh-pages.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ jobs:
1515

1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
1919
with:
2020
fetch-depth: 0 # To fetch all history for all branches and tags. (Will be required for caching with lerna: https://github.com/markuplint/markuplint/pull/111)
2121

2222
- name: Use Node.js 18.x
23-
uses: actions/setup-node@v3
23+
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
2424
with:
2525
node-version: '18.x'
2626
registry-url: 'https://registry.npmjs.org'
2727

2828
- name: Use Python 3.x
29-
uses: actions/setup-python@v4
29+
uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa # v4.8.0
3030
with:
3131
python-version: '3.x'
3232

@@ -45,14 +45,14 @@ jobs:
4545
NODE_OPTIONS: --max_old_space_size=9216
4646

4747
- name: Publish GH Pages
48-
uses: peaceiris/actions-gh-pages@v3
48+
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3
4949
with:
5050
github_token: ${{ secrets.GITHUB_TOKEN }}
5151
publish_dir: ./gh-pages
5252
force_orphan: true # will only keep latest commit on branch gh-pages
5353

5454
- name: Publish NPM
55-
uses: nick-invision/retry@v2
55+
uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0
5656
with:
5757
timeout_minutes: 5
5858
retry_wait_seconds: 30

.github/workflows/publish-next.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ jobs:
1212
timeout-minutes: 60
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
1616
with:
1717
# To fetch all history for all branches and tags.
1818
# Required for lerna to determine the version of the next package.
1919
fetch-depth: 0
2020

2121
- name: Use Node.js 18.x
22-
uses: actions/setup-node@v3
22+
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
2323
with:
2424
node-version: 18.x
2525
registry-url: "https://registry.npmjs.org"
2626

2727
- name: Use Python 3.11
28-
uses: actions/setup-python@v4
28+
uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa # v4.8.0
2929
with:
3030
python-version: "3.11"
3131

.github/workflows/publish-release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ jobs:
2222
timeout-minutes: 60
2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
2626

2727
- name: Use Node.js 18.x
28-
uses: actions/setup-node@v3
28+
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
2929
with:
3030
node-version: 18.x
3131
registry-url: "https://registry.npmjs.org"
3232

3333
- name: Use Python 3.11
34-
uses: actions/setup-python@v4
34+
uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa # v4.8.0
3535
with:
3636
python-version: "3.11"
3737

@@ -54,7 +54,7 @@ jobs:
5454
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
5555

5656
- name: Get Actor User Data
57-
uses: octokit/request-action@v2.x
57+
uses: octokit/request-action@21d174fc38ff59af9cf4d7e07347d29df6dbaa99 # v2.3.0
5858
id: actor_user_data
5959
with:
6060
route: GET /users/{user}
@@ -63,7 +63,7 @@ jobs:
6363
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6464

6565
- name: Create Pull Request
66-
uses: peter-evans/create-pull-request@v6
66+
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
6767
with:
6868
commiter: ${{ github.actor }} <${{ fromJson(steps.actor_user_data.outputs.data).email }}>
6969
author: ${{ github.actor }} <${{ fromJson(steps.actor_user_data.outputs.data).email }}>

.github/workflows/set-milestone-on-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: Checkout code
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
2929
- id: compute-milestone
3030
run: |
3131
export THEIA_CORE_VERSION=$(node -p "require(\"./packages/core/package.json\").version")
3232
echo "MILESTONE_NUMBER=$(npx -q semver@7 --increment minor $THEIA_CORE_VERSION)" >> $GITHUB_ENV
3333
- id: set
34-
uses: actions/github-script@v3
34+
uses: actions/github-script@ffc2c79a5b2490bd33e0a41c1de74b877714d736 # v3.2.0
3535
with:
3636
github-token: ${{secrets.GITHUB_TOKEN}}
3737
script: |

0 commit comments

Comments
 (0)