|
|
@ -6,6 +6,8 @@ on: |
|
|
- opened |
|
|
- opened |
|
|
- synchronize |
|
|
- synchronize |
|
|
|
|
|
|
|
|
|
|
|
permissions: {} |
|
|
|
|
|
|
|
|
env: |
|
|
env: |
|
|
# Forks and Dependabot don't have access to secrets |
|
|
# Forks and Dependabot don't have access to secrets |
|
|
HAS_SECRETS: ${{ secrets.PRE_COMMIT != '' }} |
|
|
HAS_SECRETS: ${{ secrets.PRE_COMMIT != '' }} |
|
|
@ -28,7 +30,8 @@ jobs: |
|
|
# And it needs the full history to be able to compute diffs |
|
|
# And it needs the full history to be able to compute diffs |
|
|
fetch-depth: 0 |
|
|
fetch-depth: 0 |
|
|
# A token other than the default GITHUB_TOKEN is needed to be able to trigger CI |
|
|
# A token other than the default GITHUB_TOKEN is needed to be able to trigger CI |
|
|
token: ${{ secrets.PRE_COMMIT }} |
|
|
token: ${{ secrets.PRE_COMMIT }} # zizmor: ignore[secrets-outside-env] |
|
|
|
|
|
persist-credentials: true # Required for `git push` command |
|
|
# pre-commit lite ci needs the default checkout configs to work |
|
|
# pre-commit lite ci needs the default checkout configs to work |
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
|
|
name: Checkout PR for fork |
|
|
name: Checkout PR for fork |
|
|
@ -37,6 +40,7 @@ jobs: |
|
|
# To be able to commit it needs the head branch of the PR, the remote one |
|
|
# To be able to commit it needs the head branch of the PR, the remote one |
|
|
ref: ${{ github.event.pull_request.head.sha }} |
|
|
ref: ${{ github.event.pull_request.head.sha }} |
|
|
fetch-depth: 0 |
|
|
fetch-depth: 0 |
|
|
|
|
|
persist-credentials: false |
|
|
- name: Set up Python |
|
|
- name: Set up Python |
|
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
|
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
|
|
with: |
|
|
with: |
|
|
@ -44,6 +48,7 @@ jobs: |
|
|
- name: Setup uv |
|
|
- name: Setup uv |
|
|
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 |
|
|
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 |
|
|
with: |
|
|
with: |
|
|
|
|
|
version: "0.11.4" |
|
|
cache-dependency-glob: | |
|
|
cache-dependency-glob: | |
|
|
pyproject.toml |
|
|
pyproject.toml |
|
|
uv.lock |
|
|
uv.lock |
|
|
@ -51,7 +56,7 @@ jobs: |
|
|
run: uv sync --locked --extra all |
|
|
run: uv sync --locked --extra all |
|
|
- name: Run prek - pre-commit |
|
|
- name: Run prek - pre-commit |
|
|
id: precommit |
|
|
id: precommit |
|
|
run: uvx prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure |
|
|
run: uv run prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure |
|
|
continue-on-error: true |
|
|
continue-on-error: true |
|
|
- name: Commit and push changes |
|
|
- name: Commit and push changes |
|
|
if: env.HAS_SECRETS == 'true' |
|
|
if: env.HAS_SECRETS == 'true' |
|
|
|