Skip to content

Configure permissions of GITHUB_TOKEN in workflows #566

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

Merged
merged 1 commit into from
Jun 26, 2023
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/check-certificates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
(github.event_name != 'pull_request' && github.repository == 'arduino/arduino-lint') ||
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'arduino/arduino-lint')
runs-on: ubuntu-latest
permissions: {}
strategy:
fail-fast: false

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check-code-generation-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.determination.outputs.result }}
permissions: {}
steps:
- name: Determine if the rest of the workflow should run
id: determination
Expand All @@ -51,6 +52,7 @@ jobs:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions: {}

steps:
- name: Checkout local repository
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check-general-formatting-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Set environment variables
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/check-go-dependencies-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ on:
jobs:
run-determination:
runs-on: ubuntu-latest
permissions: {}
outputs:
result: ${{ steps.determination.outputs.result }}
steps:
Expand All @@ -62,6 +63,8 @@ jobs:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
Expand Down Expand Up @@ -118,6 +121,8 @@ jobs:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/check-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:
jobs:
run-determination:
runs-on: ubuntu-latest
permissions: {}
outputs:
result: ${{ steps.determination.outputs.result }}
steps:
Expand All @@ -54,6 +55,8 @@ jobs:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
fail-fast: false
Expand Down Expand Up @@ -89,6 +92,8 @@ jobs:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
fail-fast: false
Expand Down Expand Up @@ -127,6 +132,8 @@ jobs:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
fail-fast: false
Expand Down Expand Up @@ -165,6 +172,8 @@ jobs:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
fail-fast: false
Expand Down Expand Up @@ -203,6 +212,8 @@ jobs:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
fail-fast: false
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check-license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ on:
jobs:
check-license:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check-markdown-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ on:
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
Expand All @@ -55,6 +57,8 @@ jobs:

links:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check-mkdocs-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ on:
jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check-prettier-formatting-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ on:
jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check-python-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ on:
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
Expand Down Expand Up @@ -60,6 +62,8 @@ jobs:

formatting:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/check-shell-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
lint:
name: ${{ matrix.configuration.name }}
runs-on: ubuntu-latest
permissions:
contents: read

env:
# See: https://github.com/koalaman/shellcheck/releases/latest
Expand Down Expand Up @@ -89,6 +91,8 @@ jobs:

formatting:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Set environment variables
Expand Down Expand Up @@ -132,6 +136,8 @@ jobs:

executable:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check-workflows-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ on:
jobs:
validate:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ on:
jobs:
publish-determination:
runs-on: ubuntu-latest
permissions: {}
outputs:
result: ${{ steps.determination.outputs.result }}
steps:
Expand All @@ -51,6 +52,8 @@ jobs:
runs-on: ubuntu-latest
needs: publish-determination
if: needs.publish-determination.outputs.result == 'true'
permissions:
contents: write

steps:
- name: Checkout repository
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/publish-go-nightly-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ on:
jobs:
create-nightly-artifacts:
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
matrix:
Expand Down Expand Up @@ -66,6 +68,9 @@ jobs:
checksum-darwin_amd64: ${{ steps.re-package.outputs.checksum-darwin_amd64 }}
checksum-darwin_arm64: ${{ steps.re-package.outputs.checksum-darwin_arm64 }}

permissions:
contents: read

env:
GON_CONFIG_PATH: gon.config.hcl

Expand Down Expand Up @@ -166,6 +171,7 @@ jobs:
publish-nightly:
runs-on: ubuntu-latest
needs: notarize-macos
permissions: {}

steps:
- name: Download artifact
Expand Down Expand Up @@ -194,6 +200,7 @@ jobs:
runs-on: ubuntu-latest
needs: publish-nightly
if: failure() # Run if publish-nightly or any of its job dependencies failed
permissions: {}

steps:
- name: Report failure
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/publish-go-tester-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.determination.outputs.result }}
permissions: {}
steps:
- name: Determine if the rest of the workflow should run
id: determination
Expand All @@ -57,6 +58,7 @@ jobs:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions: {}
outputs:
prefix: ${{ steps.calculation.outputs.prefix }}
steps:
Expand All @@ -75,6 +77,8 @@ jobs:
needs: package-name-prefix
name: Build ${{ matrix.os.name }}
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
matrix:
Expand Down Expand Up @@ -135,6 +139,8 @@ jobs:
- build
- package-name-prefix
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Download build artifacts
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on:
jobs:
create-release-artifacts:
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
matrix:
Expand Down Expand Up @@ -71,6 +73,8 @@ jobs:
outputs:
checksum-darwin_amd64: ${{ steps.re-package.outputs.checksum-darwin_amd64 }}
checksum-darwin_arm64: ${{ steps.re-package.outputs.checksum-darwin_arm64 }}
permissions:
contents: read

env:
GON_CONFIG_PATH: gon.config.hcl
Expand Down Expand Up @@ -172,6 +176,8 @@ jobs:
create-release:
runs-on: ubuntu-latest
needs: notarize-macos
permissions:
contents: write

steps:
- name: Download artifact
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/spell-check-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on:
jobs:
spellcheck:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ env:
jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
Expand Down Expand Up @@ -55,6 +57,7 @@ jobs:
download:
needs: check
runs-on: ubuntu-latest
permissions: {}

strategy:
matrix:
Expand Down Expand Up @@ -82,6 +85,9 @@ jobs:
sync:
needs: download
runs-on: ubuntu-latest
permissions:
contents: read
issues: write

steps:
- name: Set environment variables
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-go-integration-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.determination.outputs.result }}
permissions: {}
steps:
- name: Determine if the rest of the workflow should run
id: determination
Expand All @@ -60,6 +61,8 @@ jobs:
test:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
permissions:
contents: read

strategy:
matrix:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.determination.outputs.result }}
permissions: {}
steps:
- name: Determine if the rest of the workflow should run
id: determination
Expand All @@ -57,6 +58,8 @@ jobs:
name: test (${{ matrix.module.path }} - ${{ matrix.operating-system }})
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
permissions:
contents: read

strategy:
fail-fast: false
Expand Down
Loading