Skip to content

Commit 947f13e

Browse files
fix(ci): hardening security of GH actions
1 parent dcb189d commit 947f13e

17 files changed

+57
-175
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
# Make this a reusable workflow, no value needed
66
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
build_core:
1013
name: Core

.github/workflows/create-production-pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
create-stencil-release-pull-request:
2828
name: Generate Stencil Release PR
2929
runs-on: ubuntu-latest
30+
permissions:
31+
contents: write
32+
pull-requests: write
3033
steps:
3134
# Log the input from GitHub Actions for easy traceability
3235
- name: Log GitHub Input

.github/workflows/lint-and-format.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
# Make this a reusable workflow, no value needed
77
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
format:
1114
name: Check

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ concurrency:
1414
group: ${{ github.workflow }}-${{ github.ref }}
1515
cancel-in-progress: true
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
build_core:
1922
name: Build

.github/workflows/release-dev.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
description: The version that was just published to npm.
1111
value: ${{ jobs.get-dev-version.outputs.dev-version }}
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
build_core:
1518
name: Build
@@ -57,6 +60,7 @@ jobs:
5760
needs: [get-dev-version, build_core]
5861
runs-on: ubuntu-22.04
5962
permissions:
63+
contents: read
6064
id-token: write
6165
steps:
6266
- name: Checkout Code

.github/workflows/release-nightly.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
workflow_dispatch:
1010
# Allow this workflow to be run on-demand
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
build_core:
1417
name: Build
@@ -59,6 +62,7 @@ jobs:
5962
needs: [get-nightly-version, build_core]
6063
runs-on: ubuntu-22.04
6164
permissions:
65+
contents: read
6266
id-token: write
6367
steps:
6468
- name: Checkout Code

.github/workflows/test-analysis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
# Make this a reusable workflow, no value needed
66
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
analysis_test:
1013
name: (${{ matrix.os }}.${{ matrix.node }})

.github/workflows/test-bundlers.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
# Make this a reusable workflow, no value needed
66
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
bundler_tests:
1013
name: Verify Bundlers

.github/workflows/test-component-starter.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
# Make this a reusable workflow, no value needed
66
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
analysis_test:
1013
name: (${{ matrix.os }}.node-${{ matrix.node }}.jest-${{ matrix.jest }})

.github/workflows/test-copytask.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ on:
55
# Make this a reusable workflow, no value needed
66
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
bundler_tests:
1013
name: Verify Copy Task
1114
runs-on: 'ubuntu-22.04'
1215
steps:
1316
- name: Checkout Code
14-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
17+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
1518

1619
- name: Get Core Dependencies
1720
uses: ./.github/workflows/actions/get-core-dependencies

0 commit comments

Comments
 (0)