Skip to content

Commit

Permalink
chore: add zizmor-pre-commit to limit GH Actions vulnerabilities (#972
Browse files Browse the repository at this point in the history
)

* chore(pre-commit): add `zizmor-pre-commit`

* ci: fix vulnerabilities reported by zizmor
  • Loading branch information
mkniewallner authored Dec 19, 2024
1 parent 14cede0 commit 5fc0390
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
steps:
- name: Check out
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@v4
Expand All @@ -39,7 +41,7 @@ jobs:
run: rustup component add clippy rustfmt

- name: Run pre-commit
run: uvx pre-commit@${{ env.PRE_COMMIT_VERSION }} run -a --show-diff-on-failure
run: uvx pre-commit@${PRE_COMMIT_VERSION} run -a --show-diff-on-failure
env:
# renovate: datasource=pypi depName=pre-commit
PRE_COMMIT_VERSION: '4.0.1'
Expand All @@ -64,6 +66,8 @@ jobs:
steps:
- name: Check out
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@v4
Expand Down Expand Up @@ -101,6 +105,8 @@ jobs:
steps:
- name: Check out
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@v4
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Export tag
id: vars
Expand Down Expand Up @@ -44,6 +46,8 @@ jobs:
steps:
- name: Check out
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Download updated pyproject.toml
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -83,6 +87,8 @@ jobs:
steps:
- name: Check out
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Download updated pyproject.toml
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -118,6 +124,8 @@ jobs:
steps:
- name: Check out
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Download updated pyproject.toml
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -148,6 +156,8 @@ jobs:
needs: [set-version]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install Python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -178,6 +188,8 @@ jobs:
if: ${{ github.event_name == 'release' }}
steps:
- uses: actions/download-artifact@v4
with:
persist-credentials: false

- name: Install Python
uses: actions/setup-python@v5
Expand All @@ -199,6 +211,8 @@ jobs:
steps:
- name: Check out
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/validate-codecov-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Validate codecov configuration
run: curl -sSL --fail-with-body --data-binary @codecov.yaml https://codecov.io/validate
2 changes: 2 additions & 0 deletions .github/workflows/validate-renovate-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,8 @@ repos:
language: system
types: [rust]
pass_filenames: false

- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: "v0.10.0"
hooks:
- id: zizmor

0 comments on commit 5fc0390

Please sign in to comment.