Skip to content

Commit bee0223

Browse files
authored
Merge pull request #1271 from PHPCSStandards/feature/ghactions-improve-permissions
GH Actions: set permissions for each workflow/job
2 parents d1705d6 + e2bb1ef commit bee0223

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/publish-website.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ on:
99
# Allow running this workflow manually from the Actions tab.
1010
workflow_dispatch:
1111

12-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13-
permissions:
14-
contents: read
15-
pages: write
16-
id-token: write
12+
permissions: {}
1713

1814
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
1915
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
@@ -28,6 +24,10 @@ jobs:
2824

2925
name: "Build the website"
3026
runs-on: ubuntu-latest
27+
28+
permissions:
29+
contents: read # to read the contents of the repo
30+
3131
steps:
3232
# By default use the `gh-pages` branch.
3333
# For testing changes to the workflow or the scripts, use the PR branch
@@ -84,6 +84,10 @@ jobs:
8484
name: github-pages
8585
url: ${{ steps.deployment.outputs.page_url }}
8686

87+
permissions:
88+
pages: write # to deploy to Pages
89+
id-token: write # to verify the deployment originates from an appropriate source
90+
8791
steps:
8892
- name: Deploy to GitHub Pages
8993
id: deployment

0 commit comments

Comments
 (0)