Skip to content

chore(deps): update dependency pre-commit to v4 #2645

chore(deps): update dependency pre-commit to v4

chore(deps): update dependency pre-commit to v4 #2645

Workflow file for this run

name: Python
on:
pull_request:
branches: [main]
env:
# renovate: datasource=github-releases depName=python packageName=containerbase/python-prebuild
PYTHON_VERSION: "3.13.0"
# renovate: datasource=github-releases depName=python-poetry/poetry
POETRY_VERSION: "1.8.4"
jobs:
pre-commit:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GIT_AUTO_COMMIT_ACTION_CHECKOUT_PAT }}
- name: Install poetry
run: pipx install poetry=="${{ env.POETRY_VERSION }}"
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- run: poetry install
- name: Get pre-commit version
id: pre-commit-version
run: |
echo "pre-commit-version=$(poetry run pre-commit -V)" >> $GITHUB_OUTPUT
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: ~/.cache/pre-commit
key: ${{ steps.pre-commit-version.outputs.pre-commit-version }}|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- run: poetry run pre-commit run --show-diff-on-failure --color=always --all-files
- uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5
if: success() || failure()
with:
commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
commit_message: "chore(pre-commit): apply automatic changes"
pytest:
needs: pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Read .pre-commit-config.yaml
uses: actions-tools/yaml-outputs@1a26d8aaa36aa54fe71d91c265dd6d4369a4fcfb # v2
with:
file-path: ${{ github.workspace }}/.pre-commit-config.yaml
node: repos.10
- name: Install poetry
run: pipx install poetry=="${{ env.POETRY_VERSION }}"
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- run: poetry install
- run: poetry run pytest ${{ github.workspace }}/tests