Skip to content

Commit 4253098

Browse files
Strengthen permissions for GitHub actions workflows
1 parent fe1d0ba commit 4253098

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

.github/workflows/mkdocs-dryrun.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Generate documentation dryrun
2+
permissions:
3+
contents: read
24
on:
3-
# Documentation can be either manually updated or is automatically updated when pushed to main branch
5+
# Documentation can be either manually updated or is automatically updated
6+
# when pushed to main branch
47
workflow_dispatch:
58
push:
69
branches:

.github/workflows/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
# Make sure deploy-pages has necessary permissions to deploy to GitHub Pages
1010
permissions:
11+
contents: read
1112
pages: write
1213
id-token: write
1314

.github/workflows/publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: Publish Package on PyPi
2+
permissions:
3+
contents: read
24

35
on:
46
release:

.github/workflows/python-app.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,23 @@
33

44
name: Test and Lint
55

6-
on:
7-
pull_request:
8-
branches:
9-
- main
10-
push:
11-
branches:
12-
- main
13-
146
# Yoinked from https://github.com/MTES-MCT/apilos/pull/854/files
157
# Explicitly set permissions to allow Dependabot workflow runs to write in the PR
168
# for coverage's reporting.
179
# By default, these are read-only when the actions are ran by Dependabot
1810
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#changing-github_token-permissions
1911
permissions:
12+
contents: read
2013
pull-requests: write
2114

15+
on:
16+
pull_request:
17+
branches:
18+
- main
19+
push:
20+
branches:
21+
- main
22+
2223
jobs:
2324
Test:
2425
strategy:

0 commit comments

Comments
 (0)