Skip to content

Commit bc6652b

Browse files
committed
Resolve pre-commit.yml
1 parent 1165517 commit bc6652b

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/pre-commit.yml

Lines changed: 8 additions & 3 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,14 +40,16 @@ 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
40-
- uses: oven-sh/setup-bun@v2
43+
persist-credentials: false
44+
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
4145
- name: Set up Python
4246
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
4347
with:
4448
python-version: "3.11"
4549
- name: Setup uv
4650
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
4751
with:
52+
version: "0.11.4"
4853
cache-dependency-glob: |
4954
requirements**.txt
5055
pyproject.toml
@@ -55,7 +60,7 @@ jobs:
5560
run: bun ci
5661
- name: Run prek - pre-commit
5762
id: precommit
58-
run: uvx prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure
63+
run: uv run prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure
5964
continue-on-error: true
6065
- name: Commit and push changes
6166
if: env.HAS_SECRETS == 'true'

0 commit comments

Comments
 (0)