Skip to content

Commit 2c70c83

Browse files
authored
Pin GitHub Actions workflow step hashes and use minimum permission (#1474)
1 parent 2a6f7dd commit 2c70c83

File tree

5 files changed

+76
-63
lines changed

5 files changed

+76
-63
lines changed

.github/workflows/docs-deploy.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,26 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'docs/**'
8+
- "docs/**"
99
push:
1010
branches:
1111
- main
1212
paths:
13-
- 'docs/**'
13+
- "docs/**"
1414
workflow_dispatch:
1515

1616
jobs:
1717
build:
1818
name: Build Docusaurus
1919
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
2022
steps:
21-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2224
with:
2325
fetch-depth: 0
24-
- uses: actions/setup-node@v4
26+
persist-credentials: false
27+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2528
with:
2629
node-version: 20
2730
cache: npm
@@ -82,7 +85,7 @@ jobs:
8285
working-directory: ./docs
8386

8487
- name: Upload Build Artifact
85-
uses: actions/upload-pages-artifact@v3
88+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
8689
with:
8790
path: ./docs/build
8891

@@ -105,4 +108,4 @@ jobs:
105108
steps:
106109
- name: Deploy to GitHub Pages
107110
id: deployment
108-
uses: actions/deploy-pages@v4
111+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

.github/workflows/triage-issues.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@
44

55
name: Close stale issues and PRs
66

7-
on:
7+
on:
88
workflow_dispatch:
99
schedule:
10-
- cron: '0 0 * * 1'
11-
12-
permissions:
13-
issues: write
14-
pull-requests: write
10+
- cron: "0 0 * * 1"
1511

1612
jobs:
1713
stale:
1814
runs-on: ubuntu-latest
15+
permissions:
16+
issues: write
17+
pull-requests: write
1918
steps:
20-
- uses: actions/[email protected]
19+
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
2120
with:
2221
days-before-issue-stale: 30
2322
days-before-issue-close: 10
@@ -31,4 +30,3 @@ jobs:
3130
remove-stale-when-updated: true
3231
enable-statistics: true
3332
operations-per-run: 60
34-

.github/workflows/unit-tests-jdk-14.yml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: JDK 14 Build & Tests
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches:
6+
- main
67
pull_request:
78

89
jobs:
@@ -11,21 +12,24 @@ jobs:
1112
timeout-minutes: 12
1213
strategy:
1314
matrix:
14-
java-version: ['14']
15-
15+
java-version: ["14"]
16+
permissions:
17+
contents: read
1618
steps:
17-
- uses: actions/checkout@v4
18-
- name: Install JDK
19-
uses: actions/setup-java@v4
20-
with:
21-
java-version: ${{ matrix.java-version }}
22-
distribution: 'adopt'
23-
- name: Run all tests
24-
run: |
25-
./scripts/run_no_prep_tests.sh -ci
26-
env:
27-
SKIP_UNSTABLE_TESTS: 1
28-
- name: Upload coverage to Codecov
29-
uses: codecov/codecov-action@v5
30-
with:
31-
token: ${{ secrets.CODECOV_TOKEN }}
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
persist-credentials: false
22+
- name: Install JDK
23+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
24+
with:
25+
java-version: ${{ matrix.java-version }}
26+
distribution: "adopt"
27+
- name: Run all tests
28+
run: |
29+
./scripts/run_no_prep_tests.sh -ci
30+
env:
31+
SKIP_UNSTABLE_TESTS: 1
32+
- name: Upload coverage to Codecov
33+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
34+
with:
35+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/unit-tests-jdk-17.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: JDK 17 Build & Tests
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches:
6+
- main
67
pull_request:
78

89
jobs:
@@ -11,17 +12,20 @@ jobs:
1112
timeout-minutes: 12
1213
strategy:
1314
matrix:
14-
java-version: ['17']
15-
15+
java-version: ["17"]
16+
permissions:
17+
contents: read
1618
steps:
17-
- uses: actions/checkout@v4
18-
- name: Install JDK
19-
uses: actions/setup-java@v4
20-
with:
21-
java-version: ${{ matrix.java-version }}
22-
distribution: 'adopt'
23-
- name: Run all tests
24-
run: |
25-
./scripts/run_no_prep_tests.sh -ci
26-
env:
27-
SKIP_UNSTABLE_TESTS: 1
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
persist-credentials: false
22+
- name: Install JDK
23+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
24+
with:
25+
java-version: ${{ matrix.java-version }}
26+
distribution: "adopt"
27+
- name: Run all tests
28+
run: |
29+
./scripts/run_no_prep_tests.sh -ci
30+
env:
31+
SKIP_UNSTABLE_TESTS: 1

.github/workflows/unit-tests-jdk-8.yml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: JDK 1.8 Build & Tests
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches:
6+
- main
67
pull_request:
78

89
jobs:
@@ -11,20 +12,23 @@ jobs:
1112
timeout-minutes: 12
1213
strategy:
1314
matrix:
14-
java-version: ['8']
15-
15+
java-version: ["8"]
16+
permissions:
17+
contents: read
1618
steps:
17-
- uses: actions/checkout@v4
18-
- name: Install JDK
19-
uses: actions/setup-java@v4
20-
with:
21-
java-version: ${{ matrix.java-version }}
22-
distribution: 'adopt'
23-
- name: Run all tests
24-
run: |
25-
if [ ${{ matrix.java-version }} == "8" ]; then
26-
export TRAVIS_JDK=openjdk8
27-
fi
28-
./scripts/run_no_prep_tests.sh -ci
29-
env:
30-
SKIP_UNSTABLE_TESTS: 1
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
persist-credentials: false
22+
- name: Install JDK
23+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
24+
with:
25+
java-version: ${{ matrix.java-version }}
26+
distribution: "adopt"
27+
- name: Run all tests
28+
run: |
29+
if [ ${{ matrix.java-version }} == "8" ]; then
30+
export TRAVIS_JDK=openjdk8
31+
fi
32+
./scripts/run_no_prep_tests.sh -ci
33+
env:
34+
SKIP_UNSTABLE_TESTS: 1

0 commit comments

Comments
 (0)