Skip to content

Commit e08c61f

Browse files
[StepSecurity] Apply security best practices
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
1 parent 06ec338 commit e08c61f

8 files changed

Lines changed: 58 additions & 7 deletions

File tree

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- '!dependabot/**'
1212
workflow_dispatch:
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
analyze:
1619
name: Analyze
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Dependency Review Action
2+
#
3+
# This Action will scan dependency manifest files that change as part of a Pull Request,
4+
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
5+
# Once installed, if the workflow run is marked as required,
6+
# PRs introducing known-vulnerable packages will be blocked from merging.
7+
#
8+
# Source repository: https://github.com/actions/dependency-review-action
9+
name: 'Dependency Review'
10+
on: [pull_request]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
dependency-review:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Harden the runner (Audit all outbound calls)
20+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
21+
with:
22+
egress-policy: audit
23+
24+
- name: 'Checkout Repository'
25+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
26+
- name: 'Dependency Review'
27+
uses: actions/dependency-review-action@595b5aeba73380359d98a5e087f648dbb0edce1b # v4.7.3

.github/workflows/labeler.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ name: Pull Request Labeler
33
on:
44
- pull_request_target
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
triage:
11+
permissions:
12+
contents: read # for actions/labeler to determine modified files
13+
pull-requests: write # for actions/labeler to add labels to PRs
814
runs-on: ubuntu-latest
915
steps:
10-
- uses: actions/labeler@v6
16+
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
1117
with:
1218
repo-token: '${{ secrets.GITHUB_TOKEN }}'

.github/workflows/publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- published
77
workflow_dispatch:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest

.github/workflows/super-linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
persist-credentials: false
3131

3232
- name: Super-linter
33-
uses: super-linter/super-linter/slim@v8.1.0
33+
uses: super-linter/super-linter/slim@ffde3b2b33b745cb612d787f669ef9442b1339a6 # v8.1.0
3434
env:
3535
DEFAULT_BRANCH: main
3636
FILTER_REGEX_EXCLUDE: '/test/'

.github/workflows/sync-labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
persist-credentials: false
1919

20-
- uses: micnncim/action-label-syncer@v1
20+
- uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0
2121
with:
2222
token: ${{ secrets.GITHUB_TOKEN }}
2323
repository: ${{ github.repository }}

.github/workflows/test.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
- '**/*.md'
1010
- '**/*.mdx'
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
lint:
1417
runs-on: ubuntu-latest
@@ -30,6 +33,9 @@ jobs:
3033
run: npm run lint
3134

3235
build:
36+
permissions:
37+
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
38+
contents: read # for actions/checkout to fetch code
3339
runs-on: ${{ matrix.os }}
3440
needs: lint
3541
strategy:
@@ -43,7 +49,7 @@ jobs:
4349

4450
steps:
4551
- name: 🛑 Cancel Previous Runs
46-
uses: styfle/cancel-workflow-action@0.12.1
52+
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
4753
with:
4854
access_token: ${{ secrets.GITHUB_TOKEN }}
4955

@@ -69,23 +75,23 @@ jobs:
6975

7076
- name: Run tests
7177
if: matrix.os != 'ubuntu-latest'
72-
uses: nick-invision/retry@v3
78+
uses: nick-invision/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
7379
with:
7480
timeout_minutes: 20
7581
max_attempts: 3
7682
command: npm run test
7783

7884
- name: Run coverage
7985
if: matrix.node == '20' && matrix.os == 'ubuntu-latest'
80-
uses: nick-invision/retry@v3
86+
uses: nick-invision/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
8187
with:
8288
timeout_minutes: 20
8389
max_attempts: 3
8490
command: npm run test:coverage
8591

8692
- name: ⬆️ Upload coverage to Codecov
8793
if: matrix.node == '20' && matrix.os == 'ubuntu-latest'
88-
uses: codecov/codecov-action@v5
94+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
8995
with:
9096
files: ./coverage/coverage-final.json
9197
name: codecov-dev

.github/workflows/website.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ on:
1313
- .github/workflows/website.yml
1414
workflow_dispatch:
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
build:
21+
permissions:
22+
contents: read # for actions/checkout to fetch code
23+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
1824
runs-on: ubuntu-latest
1925
steps:
2026
- name: ⬇️ Checkout

0 commit comments

Comments
 (0)