Skip to content

Commit 4f940bf

Browse files
committed
Resolve pre-commit.yml
1 parent 69a8b03 commit 4f940bf

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/pre-commit.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- opened
77
- synchronize
88

9+
permissions: {}
10+
911
env:
1012
# Forks and Dependabot don't have access to secrets
1113
HAS_SECRETS: ${{ secrets.PRE_COMMIT != '' }}
@@ -28,7 +30,8 @@ jobs:
2830
# And it needs the full history to be able to compute diffs
2931
fetch-depth: 0
3032
# A token other than the default GITHUB_TOKEN is needed to be able to trigger CI
31-
token: ${{ secrets.PRE_COMMIT }}
33+
token: ${{ secrets.PRE_COMMIT }} # zizmor: ignore[secrets-outside-env]
34+
persist-credentials: true # Required for `git push` command
3235
# pre-commit lite ci needs the default checkout configs to work
3336
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3437
name: Checkout PR for fork
@@ -37,21 +40,23 @@ jobs:
3740
# To be able to commit it needs the head branch of the PR, the remote one
3841
ref: ${{ github.event.pull_request.head.sha }}
3942
fetch-depth: 0
43+
persist-credentials: false
4044
- name: Set up Python
4145
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
4246
with:
4347
python-version-file: ".python-version"
4448
- name: Setup uv
4549
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
4650
with:
51+
version: "0.11.4"
4752
cache-dependency-glob: |
4853
pyproject.toml
4954
uv.lock
5055
- name: Install Dependencies
5156
run: uv sync --locked
5257
- name: Run prek - pre-commit
5358
id: precommit
54-
run: uvx prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure
59+
run: uv run prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure
5560
continue-on-error: true
5661
- name: Commit and push changes
5762
if: env.HAS_SECRETS == 'true'

0 commit comments

Comments
 (0)