pre-commit autoupdate #9
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: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 6 4 * *" | |
defaults: | |
run: | |
shell: bash -el {0} | |
jobs: | |
check_update: | |
name: Check if newer version exists | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
# We need to checkout with SSH here to have actions run on the PR. | |
with: | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Set up Conda env | |
uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 | |
with: | |
environment-name: pre-commit | |
create-args: >- | |
-c | |
conda-forge | |
pre-commit | |
mamba | |
- name: Update pre-commit hooks and run | |
id: versions | |
env: | |
PRE_COMMIT_USE_MAMBA: 1 | |
run: | | |
pre-commit autoupdate | |
pre-commit run -a || true | |
- uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c | |
with: | |
commit-message: "Auto-update pre-commit hooks" | |
title: "Auto-update pre-commit hooks" | |
body: | | |
New versions of the used pre-commit hooks were detected. | |
This PR updates them to the latest and already ran `pre-commit run -a` for you to fix any changes in formatting. | |
branch: pre-commit-autoupdate | |
delete-branch: true |