Skip to content

Update template pre-commit #39

Update template pre-commit

Update template pre-commit #39

name: Update template pre-commit
permissions:
contents: write
pull-requests: write
on:
# Allow manual runs through the web UI
workflow_dispatch:
schedule:
# ┌───────── minute (0 - 59)
# │ ┌───────── hour (0 - 23)
# │ │ ┌───────── day of the month (1 - 31)
# │ │ │ ┌───────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT)
- cron: '0 7 1 * 3' # First Wednesday of the month at 7am UTC (so it can be merged before the monday package updates)
jobs:
update:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit update
id: check
run: pre-commit autoupdate -c '{{ cookiecutter.package_name }}/.pre-commit-config.yaml'
- name: Create pull request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
delete-branch: true
branch-suffix: timestamp
title: "pre-commit updates in the template"
body: |
This is an autogenerated PR, which updates the `{{ cookiecutter.package_name }}/.pre-commit-config.yaml` file.