Skip to content

Commit defe712

Browse files
authored
ci: 🔒 explicitly set permissions, move to job-level (#84)
# Description This applies some security settings as recommended by OpenSSF. No review needed.
1 parent 4a5e3d9 commit defe712

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

.github/workflows/add-to-project.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ on:
1111
- reopened
1212
- opened
1313

14-
permissions:
15-
pull-requests: write
14+
# Limit token permissions for security
15+
permissions: read-all
1616

1717
jobs:
1818
add-to-project:
1919
uses: seedcase-project/.github/.github/workflows/reusable-add-to-project.yml@main
20+
permissions:
21+
pull-requests: write
2022
with:
2123
board-number: 18
2224
app-id: ${{ vars.ADD_TO_BOARD_APP_ID }}

.github/workflows/build-package.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ on:
2121
branches:
2222
- main
2323

24-
permissions:
25-
contents: write
24+
# Limit token permissions for security
25+
permissions: read-all
2626

2727
jobs:
2828
build:
2929
uses: seedcase-project/.github/.github/workflows/reusable-build-python.yml@main
30+
# Permissions needed for pushing to the coverage branch.
31+
permissions:
32+
contents: write

.github/workflows/sync-files.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
- main
66
workflow_dispatch:
77

8+
# Limit token permissions for security
9+
permissions: read-all
10+
811
jobs:
912
sync:
1013
uses: seedcase-project/.github/.github/workflows/reusable-sync-files.yml@main

.github/workflows/update-version.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ on:
55
branches:
66
- main
77

8-
permissions:
9-
contents: write
8+
# Limit token permissions for security
9+
permissions: read-all
1010

1111
jobs:
1212
update-version:
13+
# Only give permissions for this job.
14+
permissions:
15+
contents: write
1316
uses: seedcase-project/.github/.github/workflows/reusable-update-python-project-version.yml@main
1417
with:
1518
app-id: ${{ vars.UPDATE_VERSION_APP_ID }}

0 commit comments

Comments
 (0)