Skip to content

Add minimum token permissions for all GitHub workflow files #21

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
description: "The pull request # to backport"
required: true

permissions:
contents: read

jobs:
backport:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ on:
push:
branches: [ main ]

permissions:
contents: read

jobs:
sdk-benchmarks:
permissions:
contents: write # required for pushing to gh-pages branch
pull-requests: write # required for commenting on possible performance regression
runs-on: equinix-bare-metal
steps:
- name: Checkout Core Repo @ SHA - ${{ github.sha }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
branches:
- main

permissions:
contents: read

jobs:
changelog:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
branches: [ main ]
pull_request:

permissions:
contents: read

jobs:
changedfiles:
name: changed files
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ on:
# * * * * *
- cron: '30 1 * * *'

permissions:
contents: read

jobs:
CodeQL-Build:
permissions:
security-events: write # required for uploading CodeQL results
runs-on: ubuntu-latest

steps:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- 'release/*'
pull_request:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lint_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- 'release/*'
pull_request:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/misc_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- 'release/*'
pull_request:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/prepare-patch-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ name: Prepare patch release
on:
workflow_dispatch:

permissions:
contents: read

jobs:
prepare-patch-release:
permissions:
pull-requests: write # required for adding labels to pull requests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/prepare-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ on:
description: "Pre-release version number? (e.g. 1.9.0rc2)"
required: false

permissions:
contents: read

jobs:
prereqs:
permissions:
pull-requests: write # required for adding labels to pull requests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -115,6 +120,8 @@ jobs:
gh pr edit ${{ steps.create_release_branch_pr.outputs.pr_url }} --add-label "prepare-release"

create-pull-request-against-main:
permissions:
pull-requests: write # required for adding labels to pull requests
runs-on: ubuntu-latest
needs: prereqs
steps:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ name: Release
on:
workflow_dispatch:

permissions:
contents: read

jobs:
release:
permissions:
contents: write # required for creating GitHub releases
runs-on: ubuntu-latest
steps:
- run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/templates/lint.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- 'release/*'
pull_request:

permissions:
contents: read

concurrency:
group: ${% raw %}{{ github.workflow }}-${{ github.head_ref || github.run_id }}{% endraw %}
cancel-in-progress: true
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/templates/misc.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- 'release/*'
pull_request:

permissions:
contents: read

concurrency:
group: ${% raw %}{{ github.workflow }}-${{ github.head_ref || github.run_id }}{% endraw %}
cancel-in-progress: true
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/templates/test.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- 'release/*'
pull_request:

permissions:
contents: read

concurrency:
group: ${% raw %}{{ github.workflow }}-${{ github.head_ref || github.run_id }}{% endraw %}
cancel-in-progress: true
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- 'release/*'
pull_request:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
Expand Down
141 changes: 0 additions & 141 deletions .github/workflows/test_1.yml

This file was deleted.