Skip to content

Commit d504d7d

Browse files
authored
Specify permissions in GH Action workflows (#1679)
* Specify permissions in GH Action workflows * Added contents permissions write to deploy your static files to GitHub Pages * Added permissions required by actions
1 parent 7c4b39a commit d504d7d

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
pull_request:
77
types: [opened, synchronize, reopened, closed]
88

9+
permissions: read-all
10+
911
env:
1012
GH_BOT_NAME: 'github-actions[bot]'
1113
GH_BOT_EMAIL: 'github-actions[bot]@users.noreply.github.com'
@@ -25,6 +27,14 @@ jobs:
2527

2628
runs-on: ubuntu-20.04
2729

30+
permissions:
31+
# Needed to cancel any previous runs that are not completed for a given workflow
32+
actions: write
33+
# Needed to deploy static files to GitHub Pages
34+
contents: write
35+
# Needed to add a comment to a pull request's issue
36+
pull-requests: write
37+
2838
env:
2939
python-ver: '3.9'
3040
CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels'

.github/workflows/conda-package.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- master
77
pull_request:
88

9+
permissions: read-all
10+
911
env:
1012
PACKAGE_NAME: dpnp
1113
MODULE_NAME: dpnp
@@ -58,6 +60,10 @@ jobs:
5860
python: ['3.9', '3.10', '3.11']
5961
os: [ubuntu-20.04, windows-latest]
6062

63+
permissions:
64+
# Needed to cancel any previous runs that are not completed for a given workflow
65+
actions: write
66+
6167
runs-on: ${{ matrix.os }}
6268

6369
defaults:

.github/workflows/generate_coverage.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ on:
44
push:
55
branches: [master]
66

7+
permissions: read-all
8+
79
jobs:
810
generate-coverage:
911
name: Generate coverage and push to Coveralls.io
1012
runs-on: ubuntu-20.04
1113

14+
permissions:
15+
# Needed to cancel any previous runs that are not completed for a given workflow
16+
actions: write
17+
1218
defaults:
1319
run:
1420
shell: bash -l {0}

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
push:
66
branches: [master]
77

8+
permissions: read-all
9+
810
jobs:
911
pre-commit:
1012
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)