Skip to content

Commit c77de1c

Browse files
committed
fix(actions): Add missing permissions for workflows
1 parent f6b1910 commit c77de1c

21 files changed

+75
-9
lines changed

.github/workflows/allboards.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
repository_dispatch:
66
types: [test-boards]
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
find-boards:
1013
runs-on: ubuntu-latest
@@ -36,10 +39,6 @@ jobs:
3639
with:
3740
ref: ${{ github.event.client_payload.branch }}
3841

39-
- run: npm install
40-
- name: Setup jq
41-
uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1
42-
4342
- id: set-test-chunks
4443
name: Set Chunks
4544
run: echo "test-chunks<<EOF" >> $GITHUB_OUTPUT

.github/workflows/boards.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- "libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
99
- ".github/workflows/boards.yml"
1010

11+
permissions:
12+
contents: read
13+
1114
env:
1215
# It's convenient to set variables for values used multiple times in the workflow
1316
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
@@ -24,9 +27,6 @@ jobs:
2427
- name: Checkout repository
2528
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2629

27-
- name: Setup jq
28-
uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1
29-
3030
- name: Get board name
3131
run: bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.base_ref}}
3232

.github/workflows/build_component.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ on:
4545
- "!*.txt"
4646
- "!*.properties"
4747

48+
permissions:
49+
contents: read
50+
4851
concurrency:
4952
group: build-component-${{github.event.pull_request.number || github.ref}}
5053
cancel-in-progress: true
@@ -114,6 +117,7 @@ jobs:
114117
submodules: recursive
115118
path: components/arduino-esp32
116119

120+
# Need to install jq in the container to be able to use it in the script
117121
- name: Setup jq
118122
uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1
119123

.github/workflows/build_py_tools.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
- "tools/gen_esp32part.py"
1010
- "tools/gen_insights_package.py"
1111

12+
permissions:
13+
contents: write
14+
pull-requests: read
15+
1216
jobs:
1317
find-changed-tools:
1418
name: Check if tools have been changed

.github/workflows/codeql.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ on:
1515
- ".github/workflows/*.yml"
1616
- ".github/workflows/*.yaml"
1717

18+
permissions:
19+
actions: read
20+
contents: read
21+
pull-requests: read
22+
security-events: write
23+
1824
jobs:
1925
codeql-analysis:
2026
name: CodeQL ${{ matrix.language }} analysis

.github/workflows/docs_build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
- "docs/**"
1414
- ".github/workflows/docs_build.yml"
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
build-docs:
1821
name: Build ESP-Docs

.github/workflows/docs_deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
- "docs/**"
1414
- ".github/workflows/docs_deploy.yml"
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
deploy-prod-docs:
1821
name: Deploy Documentation on Production

.github/workflows/gh-pages.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
- ".github/scripts/on-pages.sh"
1111
- ".github/workflows/gh-pages.yml"
1212

13+
permissions:
14+
contents: write
15+
pages: write
16+
1317
jobs:
1418
build-pages:
1519
name: Build GitHub Pages

.github/workflows/lib.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ concurrency:
1313
group: libs-${{ github.event.pull_request.number || github.ref }}
1414
cancel-in-progress: true
1515

16+
permissions:
17+
contents: write
18+
pull-requests: read
19+
1620
env:
1721
# It's convenient to set variables for values used multiple times in the workflow
1822
SKETCHES_REPORTS_PATH: libraries-report

.github/workflows/pre-commit.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ concurrency:
1212
group: pre-commit-${{github.event.pull_request.number || github.ref}}
1313
cancel-in-progress: true
1414

15+
permissions:
16+
contents: write
17+
pull-requests: read
18+
1519
jobs:
1620
lint:
1721
if: |

0 commit comments

Comments
 (0)