Skip to content

Commit

Permalink
GitHub Workflows security hardening (#2444)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
sashashura and chayim committed Nov 21, 2022
1 parent e425674 commit e3e223b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
schedule:
- cron: '0 1 * * *' # nightly build

permissions:
contents: read # to fetch code (actions/checkout)

jobs:

dependency-audit:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
release:
types: [published]

permissions:
contents: read # to fetch code (actions/checkout)

jobs:

build_and_package:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ on:
branches:
- master

permissions: {}
jobs:
update_release_draft:
permissions:
pull-requests: write # to add label to PR (release-drafter/release-drafter)
contents: write # to create a github release (release-drafter/release-drafter)

runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ on:
schedule:
- cron: "0 0 * * *"

permissions: {}
jobs:
stale:
permissions:
issues: write # to close stale issues (actions/stale)
pull-requests: write # to close stale PRs (actions/stale)

runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
Expand Down

0 comments on commit e3e223b

Please sign in to comment.