Skip to content

Commit

Permalink
ci: use fine-grained job-token permissions
Browse files Browse the repository at this point in the history
Not much changes, but splitting the global workflow permissions from the
job permissions is best practice.

Signed-off-by: Felix Moessbauer <[email protected]>
  • Loading branch information
fmoessbauer committed Sep 27, 2024
1 parent 3bda239 commit eaba3b8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ on:
# Sets permissions of the GITHUB_TOKEN to checkout the repository
permissions:
contents: read
id-token: write
attestations: write

env:
WEB_EXT_VERS: 8.2.0
Expand Down Expand Up @@ -42,6 +40,9 @@ jobs:
build-xpi:
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
steps:
- name: checkout repository
uses: actions/checkout@v4
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/deploy-update-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ on:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ on:
- 'v*.*'
- 'v*.*.*'

# Sets permissions of the GITHUB_TOKEN to checkout the repository
permissions:
contents: write
pull-requests: write
id-token: write
attestations: write
permissions: {}

env:
WEB_EXT_VERS: 8.2.0

jobs:
release-extension:
permissions:
contents: write
pull-requests: write
id-token: write
attestations: write
runs-on: ubuntu-latest
steps:
- name: checkout repository
Expand Down

0 comments on commit eaba3b8

Please sign in to comment.