diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index dd219f8..91539b6 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,3 +1,4 @@ +# https://github.com/j178/prek name: pre-commit on: [pull_request] @@ -7,26 +8,17 @@ permissions: jobs: pre-commit: - name: Run pre-commit # https://pre-commit.com/ + name: Run pre-commit runs-on: ubuntu-latest steps: - - name: Checkout Code + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@v6 with: persist-credentials: false - - uses: actions/setup-python@v6 # https://www.python.org/ + - uses: ruby/setup-ruby@v1 with: - python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax - architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified - - name: Install dependencies # https://pip.pypa.io/en/stable/ - run: | - python -m pip install --upgrade pip - pip install pre-commit - - name: Set PY - run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> "$GITHUB_ENV" - - uses: actions/cache@v5 + ruby-version: '3.4' + bundler-cache: true + - uses: j178/prek-action@v2 with: - path: ~/.cache/pre-commit - key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} - - name: Run pre-commit - run: pre-commit run --all-files + extra-args: --all-files