Dependabot on pre-commit hooks #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dependabot on pre-commit hooks | |
concurrency: | |
cancel-in-progress: true | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
on: | |
schedule: | |
- cron: 13 2 * * 0 # weekly | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
cache: pip | |
cache-dependency-path: pyproject.toml | |
check-latest: true | |
python-version: 3.11 | |
- name: Install deps | |
env: | |
PIP_UPGRADE: True | |
PIP_UPGRADE_STRATEGY: eager | |
run: python -m pip install -e ".[dev]" | |
- name: Autoupdate pre-commit | |
run: pre-commit autoupdate | |
- name: Pre-commit cache | |
id: cache-pre-commit | |
uses: actions/[email protected] | |
with: | |
key: ${{ hashFiles('.pre-commit-config.yaml') }} | |
path: ~/.cache/pre-commit | |
- name: Update pre-commit cache if needed | |
if: ${{ ! steps.cache-pre-commit.outputs.cache-hit }} | |
run: pre-commit install-hooks | |
- name: Open dependabot-like PR | |
uses: peter-evans/[email protected] | |
with: | |
author: "GitHub <[email protected]>" | |
base: ${{ github.ref_name }} | |
branch: dependabot/pre-commit/${{ github.ref_name }} | |
committer: "GitHub <[email protected]>" | |
commit-message: "chore(dev): bump pre-commit hooks" | |
labels: | | |
dependencies | |
pre-commit | |
title: "chore(dev): bump pre-commit hooks" |