Skip to content

Commit

Permalink
Create update-pre-commit-hooks.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
entorb committed Apr 29, 2024
1 parent bc563c9 commit 1bf27c0
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/update-pre-commit-hooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: update pre-commit hooks versions

on:
schedule:
- cron: "51 5 * * 1" # every monday morning
workflow_dispatch: # manual trigger

permissions:
contents: write

jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: python set up
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"

- name: python cache set up
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-py-cache

- name: install pre-commit
run: |
pip install pre-commit
- name: run pre-commit autoupdate
run: |
pre-commit autoupdate
- name: commit changes if any
run: |
if [[ $(git status --porcelain) ]]; then
git config --global user.name 'Torben'
git config --global user.email '59419684+entorb@users.noreply.github.com'
git commit -am "Update .pre-commit-config.yaml"
git push
fi

0 comments on commit 1bf27c0

Please sign in to comment.