pre-commit autoupdate #7
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: pre-commit autoupdate | |
on: | |
schedule: | |
- cron: 0 0 1 * * # first day of the month | |
workflow_dispatch: | |
jobs: | |
pre-commit-autoupdate: | |
name: Update pre-commit hooks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version-file: '.python-version' | |
check-latest: true | |
- name: Upgrade `pip` | |
run: python -m pip install --upgrade pip | |
- name: Install pre-commit | |
run: pip install pre-commit | |
- name: Update pre-commit hooks | |
run: pre-commit autoupdate | |
- name: Open a pull request | |
id: create-pr | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
add-paths: .pre-commit-config.yaml | |
commit-message: '[pre-commit] automatic update' | |
title: '[pre-commit] automatic update' | |
body: '' | |
# TODO: figure out how to enable this | |
# - name: Enable pull request automerge | |
# if: steps.create-pr.outputs.pull-request-operation == 'created' | |
# uses: peter-evans/enable-pull-request-automerge@v3 | |
# with: | |
# pull-request-number: ${{ steps.create-pr.outputs.pull-request-number }} | |
# merge-method: squash |