Skip to content

Commit dc2b0e4

Browse files
Merge pull request #2843 from lukaszstolarczuk/fix-permissions-workflows
[CI] Set top-level permissions to least required in all workflows
2 parents f313bf2 + 49ee3e9 commit dc2b0e4

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

.github/workflows/docs.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ on:
99
# Allows you to run this workflow manually from the Actions tab
1010
workflow_dispatch:
1111

12-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1312
permissions:
1413
contents: read
15-
pages: write
16-
id-token: write
1714

1815
# Allow one concurrent deployment
1916
concurrency:
@@ -76,6 +73,12 @@ jobs:
7673
url: ${{ steps.deployment.outputs.page_url }}
7774
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-22.04' || 'ubuntu-latest' }}
7875
needs: build
76+
77+
# Sets permissions to allow deployment to GitHub Pages
78+
permissions:
79+
pages: write
80+
id-token: write
81+
7982
steps:
8083
- name: Deploy to GitHub Pages
8184
id: deployment

.github/workflows/pr-migration-auto-close.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ on:
77
workflow_dispatch:
88

99
permissions:
10-
pull-requests: write
11-
issues: write
10+
contents: read
1211

1312
jobs:
1413
close-stale-prs:
1514
runs-on: ubuntu-latest
15+
permissions:
16+
pull-requests: write
17+
issues: write
18+
1619
steps:
1720
- name: Close PRs labeled "auto-close"
1821
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0

.github/workflows/pr-migration-warn.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ on:
77
workflow_dispatch:
88

99
permissions:
10-
pull-requests: write
11-
issues: write
10+
contents: read
1211

1312
jobs:
1413
label-and-comment:
1514
runs-on: ubuntu-latest
15+
permissions:
16+
pull-requests: write
17+
issues: write
18+
1619
steps:
1720
- name: Label and comment on open PRs
1821
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0

0 commit comments

Comments
 (0)