|
|
@ -21,14 +21,21 @@ jobs: |
|
|
name: Checkout PR for own repo |
|
|
name: Checkout PR for own repo |
|
|
if: env.IS_FORK == 'false' |
|
|
if: env.IS_FORK == 'false' |
|
|
with: |
|
|
with: |
|
|
# To be able to commit it needs more than the last commit |
|
|
# To be able to commit it needs to fetch the head of the branch, not the |
|
|
|
|
|
# merge commit |
|
|
ref: ${{ github.head_ref }} |
|
|
ref: ${{ github.head_ref }} |
|
|
|
|
|
# And it needs the full history to be able to compute diffs |
|
|
|
|
|
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 }} |
|
|
# 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@v5 |
|
|
- uses: actions/checkout@v5 |
|
|
name: Checkout PR for fork |
|
|
name: Checkout PR for fork |
|
|
if: env.IS_FORK == 'true' |
|
|
if: env.IS_FORK == 'true' |
|
|
|
|
|
with: |
|
|
|
|
|
# To be able to commit it needs the head branch of the PR, the remote one |
|
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }} |
|
|
|
|
|
fetch-depth: 0 |
|
|
- name: Set up Python |
|
|
- name: Set up Python |
|
|
uses: actions/setup-python@v6 |
|
|
uses: actions/setup-python@v6 |
|
|
with: |
|
|
with: |
|
|
@ -44,12 +51,9 @@ jobs: |
|
|
run: | |
|
|
run: | |
|
|
uv venv |
|
|
uv venv |
|
|
uv pip install -r requirements.txt |
|
|
uv pip install -r requirements.txt |
|
|
- name: Run pre-commit |
|
|
- name: Run prek - pre-commit |
|
|
id: precommit |
|
|
id: precommit |
|
|
run: | |
|
|
run: uvx prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure |
|
|
# Fetch the base branch for comparison |
|
|
|
|
|
git fetch origin ${{ github.base_ref }} |
|
|
|
|
|
uvx pre-commit 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.IS_FORK == 'false' |
|
|
if: env.IS_FORK == 'false' |
|
|
|