update pre-commit hooks #1066
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: update pre-commit hooks | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "*/5 3 * * *" | |
jobs: | |
update-template: | |
if: github.repository == 'alan-turing-institute/python-project-template' | |
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: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install pre-commit | |
run: pip install pre-commit | |
- name: Update pre-commit hooks | |
run: | | |
cd project_template | |
pre-commit autoupdate | |
- name: Push changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
add_options: "-u" | |
commit_message: "chore: update pre-commit hooks" |