Skip to content

Commit a0ecdf1

Browse files
authored
ci: add zizmor pre-commit hook and fix issues (#462)
1 parent 85388b8 commit a0ecdf1

File tree

5 files changed

+28
-8
lines changed

5 files changed

+28
-8
lines changed

.github/workflows/downstream.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v4
2525
with:
26+
persist-credentials: false
2627
path: cleo
2728

2829
- uses: actions/checkout@v4
2930
with:
31+
persist-credentials: false
3032
path: poetry
3133
repository: python-poetry/poetry
3234
ref: ${{ matrix.ref }}

.github/workflows/news.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414
with:
15+
persist-credentials: false
1516
# `towncrier check` runs `git diff --name-only origin/main...`, which
1617
# needs a non-shallow clone.
1718
fetch-depth: 0
1819

1920
- name: Check news entry
2021
if: "!contains(github.event.pull_request.labels.*.name, 'skip news')"
2122
run: |
22-
pipx run towncrier check --compare-with origin/${{ github.base_ref }}
23+
pipx run towncrier check --compare-with "origin/${BASE_REF}"
24+
env:
25+
BASE_REF: ${{ github.base_ref }}

.github/workflows/release.yaml

+12-7
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ jobs:
99
name: Build
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
12+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
13+
with:
14+
persist-credentials: false
1315

1416
- run: pipx run build
1517

16-
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
18+
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
1719
with:
1820
name: distfiles
1921
path: dist/
@@ -27,16 +29,19 @@ jobs:
2729
needs: build
2830
steps:
2931
# We need to be in a git repo for gh to work.
30-
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
32+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+
with:
34+
persist-credentials: false
3135

32-
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
36+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
3337
with:
3438
name: distfiles
3539
path: dist/
3640

37-
- run: gh release upload ${{ github.event.release.tag_name }} dist/*.{tar.gz,whl}
41+
- run: gh release upload "${TAG_NAME}" dist/*.{tar.gz,whl}
3842
env:
3943
GH_TOKEN: ${{ github.token }}
44+
TAG_NAME: ${{ github.event.release.tag_name }}
4045

4146
upload-pypi:
4247
name: Upload (PyPI)
@@ -48,11 +53,11 @@ jobs:
4853
id-token: write
4954
needs: build
5055
steps:
51-
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
56+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
5257
with:
5358
name: distfiles
5459
path: dist/
5560

56-
- uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14
61+
- uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc # v1.12.2
5762
with:
5863
print-hash: true

.github/workflows/tests.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929

3030
steps:
3131
- uses: actions/checkout@v4
32+
with:
33+
persist-credentials: false
3234

3335
- name: Install Poetry
3436
run: pipx install poetry

.pre-commit-config.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ repos:
2626
hooks:
2727
- id: ruff
2828
- id: ruff-format
29+
30+
- repo: https://github.com/woodruffw/zizmor-pre-commit
31+
rev: v0.8.0
32+
hooks:
33+
- id: zizmor
34+
# types and files can be removed with https://github.com/woodruffw/zizmor-pre-commit/pull/2
35+
types: [yaml]
36+
files: \.github/workflows/.*$

0 commit comments

Comments
 (0)