Skip to content

Commit e3e223b

Browse files
sashashurachayim
andauthored
GitHub Workflows security hardening (#2444)
* build: harden pypi-publish.yaml permissions Signed-off-by: Alex <aleksandrosansan@gmail.com> * build: harden stale-issues.yml permissions Signed-off-by: Alex <aleksandrosansan@gmail.com> * build: harden release-drafter.yml permissions Signed-off-by: Alex <aleksandrosansan@gmail.com> * build: harden integration.yaml permissions Signed-off-by: Alex <aleksandrosansan@gmail.com> Signed-off-by: Alex <aleksandrosansan@gmail.com> Co-authored-by: Chayim <chayim@users.noreply.github.com>
1 parent e425674 commit e3e223b

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

.github/workflows/integration.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ on:
1616
schedule:
1717
- cron: '0 1 * * *' # nightly build
1818

19+
permissions:
20+
contents: read # to fetch code (actions/checkout)
21+
1922
jobs:
2023

2124
dependency-audit:

.github/workflows/pypi-publish.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
release:
55
types: [published]
66

7+
permissions:
8+
contents: read # to fetch code (actions/checkout)
9+
710
jobs:
811

912
build_and_package:

.github/workflows/release-drafter.yml

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

9+
permissions: {}
910
jobs:
1011
update_release_draft:
12+
permissions:
13+
pull-requests: write # to add label to PR (release-drafter/release-drafter)
14+
contents: write # to create a github release (release-drafter/release-drafter)
15+
1116
runs-on: ubuntu-latest
1217
steps:
1318
# Drafts your next Release notes as Pull Requests are merged into "master"

.github/workflows/stale-issues.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ on:
33
schedule:
44
- cron: "0 0 * * *"
55

6+
permissions: {}
67
jobs:
78
stale:
9+
permissions:
10+
issues: write # to close stale issues (actions/stale)
11+
pull-requests: write # to close stale PRs (actions/stale)
12+
813
runs-on: ubuntu-latest
914
steps:
1015
- uses: actions/stale@v3

0 commit comments

Comments
 (0)