Skip to content

Commit

Permalink
Use harden-runner Action for all Workflows (#506)
Browse files Browse the repository at this point in the history
* Use harden-runner Action for all Workflows

Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>

* Test fmt

Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>

* Auto-format files

* Add block policies

Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>

---------

Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
Co-authored-by: panther-bot-automation <github-service-account-automation@panther.io>
  • Loading branch information
egibs and panther-bot-automation authored May 29, 2024
1 parent 33b6ce4 commit 6d596d7
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/asana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ on:
- opened
- closed

permissions:
contents: read

jobs:
update_task_on_pr_open:
if: ${{ github.event.pull_request.state == 'open' }}
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
with:
egress-policy: audit
- uses: panther-labs/github-asana-action@v3.0.7
name: Adds a comment to the related Asana task whenever a PR has been opened
with:
Expand All @@ -30,6 +36,9 @@ jobs:
if: ${{ github.event.pull_request.state == 'closed' }}
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
with:
egress-policy: audit
- uses: panther-labs/github-asana-action@v3.0.7
name: Adds a comment to the related Asana task when the PR is closed
with:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
on: [push, pull_request]

permissions:
contents: read

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
files.pythonhosted.org:443
github.com:443
ipinfo.io:443
pypi.org:443
- name: Checkout
uses: actions/checkout@v3.1.0
- name: Setup Python
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,21 @@ on:
branches:
- '*' # Match all branches

permissions:
contents: write

jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
files.pythonhosted.org:443
github.com:443
pypi.org:443
- name: Checkout
uses: actions/checkout@v3

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test_release_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ name: Build, Test, Publish Github and PyPI Releases
on:
workflow_dispatch:

permissions:
contents: write

jobs:
publish_github_release_and_pypi:
runs-on: ubuntu-latest

steps:
- uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
with:
egress-policy: audit

- name: Check out the repository
uses: actions/checkout@v3
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/version_bump_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ on:
required: true
default: 'minor'

permissions:
contents: write

jobs:
version_bump_pr:
runs-on: ubuntu-latest

steps:
- uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
with:
egress-policy: audit
- name: Check out the repository
uses: actions/checkout@v3
with:
Expand Down

0 comments on commit 6d596d7

Please sign in to comment.