Skip to content

Commit 2aca54c

Browse files
authored
GitHub Workflows security hardening (#1249)
1 parent 91d69ad commit 2aca54c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.github/workflows/nodejs.yml

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

17+
permissions:
18+
contents: read # to fetch code (actions/checkout)
19+
1720
jobs:
1821
prepare-yarn-cache-ubuntu:
1922
uses: ./.github/workflows/prepare-cache.yml
@@ -125,6 +128,9 @@ jobs:
125128
'echo "::error file={}::This needs to be regenerated by running \`tools:regenerate-docs\`" && false'
126129
127130
release:
131+
permissions:
132+
contents: write # for semantic-release
133+
128134
if:
129135
# prettier-ignore
130136
${{ github.event_name == 'push' && (github.event.ref == 'refs/heads/main' || github.event.ref == 'refs/heads/next') }}

.github/workflows/smoke-test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@ on:
55
- cron: '0 0 * * SUN'
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read # to fetch code (actions/checkout)
10+
811
jobs:
912
test:
13+
permissions:
14+
contents: read # to fetch code (actions/checkout)
15+
issues: write # to create comment
16+
pull-requests: read # for searching pull requests
17+
1018
runs-on: ubuntu-latest
1119
steps:
1220
- uses: actions/checkout@v3

0 commit comments

Comments
 (0)