Skip to content

fix(actions): Add missing permissions for workflows #11709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/allboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
repository_dispatch:
types: [test-boards]

permissions:
contents: read

jobs:
find-boards:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -36,10 +39,6 @@ jobs:
with:
ref: ${{ github.event.client_payload.branch }}

- run: npm install
- name: Setup jq
uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1

- id: set-test-chunks
name: Set Chunks
run: echo "test-chunks<<EOF" >> $GITHUB_OUTPUT
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/boards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
- "libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
- ".github/workflows/boards.yml"

permissions:
contents: read

env:
# It's convenient to set variables for values used multiple times in the workflow
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Expand All @@ -24,9 +27,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup jq
uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1

- name: Get board name
run: bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.base_ref}}

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ on:
- "!*.txt"
- "!*.properties"

permissions:
contents: read

concurrency:
group: build-component-${{github.event.pull_request.number || github.ref}}
cancel-in-progress: true
Expand Down Expand Up @@ -114,6 +117,7 @@ jobs:
submodules: recursive
path: components/arduino-esp32

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

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build_py_tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
- "tools/gen_esp32part.py"
- "tools/gen_insights_package.py"

permissions:
contents: write
pull-requests: read

jobs:
find-changed-tools:
name: Check if tools have been changed
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ on:
- ".github/workflows/*.yml"
- ".github/workflows/*.yaml"

permissions:
actions: read
contents: read
pull-requests: read
security-events: write

jobs:
codeql-analysis:
name: CodeQL ${{ matrix.language }} analysis
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docs_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
- "docs/**"
- ".github/workflows/docs_build.yml"

permissions:
contents: read

jobs:
build-docs:
name: Build ESP-Docs
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docs_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
- "docs/**"
- ".github/workflows/docs_deploy.yml"

permissions:
contents: read

jobs:
deploy-prod-docs:
name: Deploy Documentation on Production
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
- ".github/scripts/on-pages.sh"
- ".github/workflows/gh-pages.yml"

permissions:
contents: write
pages: write

jobs:
build-pages:
name: Build GitHub Pages
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ concurrency:
group: libs-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: write
pull-requests: read
pages: write

env:
# It's convenient to set variables for values used multiple times in the workflow
SKETCHES_REPORTS_PATH: libraries-report
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ concurrency:
group: pre-commit-${{github.event.pull_request.number || github.ref}}
cancel-in-progress: true

permissions:
contents: write
pull-requests: read

jobs:
lint:
if: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/publishlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ env:
SKETCHES_REPORTS_PATH: artifacts/libraries-report
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

permissions:
contents: read
pull-requests: write

jobs:
lib-test-results:
name: External Libraries Test Results
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/publishsizes-2.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ env:
RESULT_SIZES_TEST_FILE: SIZES_TEST.md
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

permissions:
contents: write
pull-requests: write

jobs:
sizes-test-results:
name: Sizes Comparison Results
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/publishsizes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ env:
SKETCHES_REPORTS_PATH: artifacts/sizes-report
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

permissions:
contents: read
pull-requests: write
pages: write

jobs:
sizes-test-results:
name: Sizes Comparison Results
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ concurrency:
group: build-${{github.event.pull_request.number || github.ref}}
cancel-in-progress: true

permissions:
contents: write
pull-requests: read
pages: write

env:
MAX_CHUNKS: 15

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
release:
types: published

permissions:
contents: write
pages: write

jobs:
build:
name: Publish Release
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ concurrency:
group: tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: read

jobs:
push-event-file:
name: Push event file
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tests_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
description: "Chip to build tests for"
required: true

permissions:
contents: read

jobs:
build-tests:
name: Build ${{ inputs.type }} tests for ${{ inputs.chip }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tests_hw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
description: "Chip to run tests for"
required: true

permissions:
contents: read

env:
DEBIAN_FRONTEND: noninteractive

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tests_qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
required: true
type: string

permissions:
contents: read

jobs:
qemu-test:
name: QEMU ${{ inputs.chip }} ${{ inputs.type }} tests
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tests_results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
- completed

# No permissions by default
permissions: { contents: read }
permissions:
contents: read

jobs:
unit-test-results:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tests_wokwi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
- completed

# No permissions by default
permissions: { contents: read }
permissions:
contents: read

env:
WOKWI_TIMEOUT: 600000 # Milliseconds
Expand Down
Loading