Skip to content

chore(deploy): update from image update automation #7858

chore(deploy): update from image update automation

chore(deploy): update from image update automation #7858

Workflow file for this run

name: pre-commit
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
env:
# renovate: datasource=pypi depName=pre-commit versioning=pep440
PRE_COMMIT_VERSION: ==3.7.1
jobs:
pre-commit:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Check if pre-commit should run on all files
id: run-all-files
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5.3.1
continue-on-error: true
with:
do_not_skip: '["schedule", "workflow_dispatch"]'
paths: |-
[
".github/workflows/pre-commit.yml",
".pre-commit-config.yaml"
]
skip_after_successful_duplicate: false
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Set up pre-commit
run: pipx install "pre-commit${PRE_COMMIT_VERSION}"
- name: Set pre-commit cache key parts
run: |
echo "PY_HASH=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Set up pre-commit cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ env.PY_HASH }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: |
declare -a EXTRA_ARGS=()
if [[ '${{ steps.run-all-files.outputs.should_skip }}' != 'true' ]]; then
EXTRA_ARGS=(--all-files)
elif [[ "${GITHUB_EVENT_NAME}" == 'pull_request' ]]; then
EXTRA_ARGS=(--from-ref "origin/${GITHUB_BASE_REF}" --to-ref "${GITHUB_SHA}")
else
EXTRA_ARGS=(--from-ref "${GITHUB_SHA}^" --to-ref "${GITHUB_SHA}")
fi
pre-commit run --show-diff-on-failure --color=always "${EXTRA_ARGS[@]}"
- name: 'pre-commit-ci-lite: Apply automatic fixes'
uses: pre-commit-ci/lite-action@9d882e7a565f7008d4faf128f27d1cb6503d4ebf # v1.0.2
if: always()