Skip to content

Commit

Permalink
Add a Github action to update pre-commit linters
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Mar 31, 2023
1 parent d6eec0d commit 9cad95c
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/pre-commit-autoupdate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Pre-commit auto-update

on:
schedule:
- cron: '12 0 * * *'
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit autoupdate
run: pre-commit autoupdate

- name: Run pre-commit checks
run: pre-commit run -a

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-autoupdate
title: Auto-update pre-commit hooks
commit-message: Auto-update pre-commit hooks
body: |
Update the versions of tools in pre-commit config to their latest version.
labels: dependencies
signoff: true
delete-branch: true

0 comments on commit 9cad95c

Please sign in to comment.