Skip to content

Commit

Permalink
ci: add zizmor pre-commit hook and fix issues (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
radoering authored Dec 11, 2024
1 parent 85388b8 commit a0ecdf1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/downstream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
path: cleo

- uses: actions/checkout@v4
with:
persist-credentials: false
path: poetry
repository: python-poetry/poetry
ref: ${{ matrix.ref }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/news.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
# `towncrier check` runs `git diff --name-only origin/main...`, which
# needs a non-shallow clone.
fetch-depth: 0

- name: Check news entry
if: "!contains(github.event.pull_request.labels.*.name, 'skip news')"
run: |
pipx run towncrier check --compare-with origin/${{ github.base_ref }}
pipx run towncrier check --compare-with "origin/${BASE_REF}"
env:
BASE_REF: ${{ github.base_ref }}
19 changes: 12 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- run: pipx run build

- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: distfiles
path: dist/
Expand All @@ -27,16 +29,19 @@ jobs:
needs: build
steps:
# We need to be in a git repo for gh to work.
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: distfiles
path: dist/

- run: gh release upload ${{ github.event.release.tag_name }} dist/*.{tar.gz,whl}
- run: gh release upload "${TAG_NAME}" dist/*.{tar.gz,whl}
env:
GH_TOKEN: ${{ github.token }}
TAG_NAME: ${{ github.event.release.tag_name }}

upload-pypi:
name: Upload (PyPI)
Expand All @@ -48,11 +53,11 @@ jobs:
id-token: write
needs: build
steps:
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: distfiles
path: dist/

- uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14
- uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc # v1.12.2
with:
print-hash: true
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install Poetry
run: pipx install poetry
Expand Down
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ repos:
hooks:
- id: ruff
- id: ruff-format

- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v0.8.0
hooks:
- id: zizmor
# types and files can be removed with https://github.com/woodruffw/zizmor-pre-commit/pull/2
types: [yaml]
files: \.github/workflows/.*$

0 comments on commit a0ecdf1

Please sign in to comment.