Skip to content

Commit bf1286d

Browse files
committed
ci: harden GitHub Actions workflows (SHA-pin, permissions, persist-credentials)
1 parent bf2d154 commit bf1286d

3 files changed

Lines changed: 19 additions & 8 deletions

File tree

.github/workflows/docs-public.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,31 @@ on:
99
# Allows you to run this workflow manually from the Actions tab
1010
workflow_dispatch:
1111

12+
permissions: {}
13+
1214
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1315
jobs:
1416
# This workflow contains a single job called "build"
1517
build:
1618
# The type of runner that the job will run on
1719
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
1822

1923
# Steps represent a sequence of tasks that will be executed as part of the job
2024
steps:
2125
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22-
- uses: actions/checkout@v4
23-
- uses: actions/setup-node@v6
26+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
27+
with:
28+
persist-credentials: false
29+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
2430
with:
2531
node-version: 24
2632
- name: Build website
2733
run: cd website && yarn && yarn build
2834
- name: Deploy to GitHub Pages
2935
if: success()
30-
uses: crazy-max/ghaction-github-pages@v2
36+
uses: crazy-max/ghaction-github-pages@59173cb633d9a3514f5f4552a6a3e62c6710355c # v2.7.0
3137
with:
3238
target_branch: gh-pages
3339
build_dir: website/build

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
release:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v4
21-
- uses: actions/setup-node@v6
20+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
21+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
2222
with:
2323
node-version: 24
2424
registry-url: https://registry.npmjs.org

.github/workflows/test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ name: Test
55

66
on: ["push", "pull_request"]
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
build:
1013
runs-on: ubuntu-latest
1114
steps:
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-node@v6
15+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
16+
with:
17+
persist-credentials: false
18+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
1419
with:
1520
node-version: 24
1621
- name: yarn install
@@ -21,6 +26,6 @@ jobs:
2126
run: yarn coverage
2227
- name: perf test
2328
run: yarn test:perf
24-
- uses: coverallsapp/github-action@v1.1.2
29+
- uses: coverallsapp/github-action@8cbef1dea373ebce56de0a14c68d6267baa10b44 # v1.1.2
2530
with:
2631
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)