Skip to content

Commit

Permalink
Add Pre-commit Updater workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
danyeaw committed Nov 5, 2024
1 parent d691456 commit 87e08a7
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/pre-commit-updater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Pre-commit updater
on:
workflow_dispatch:
schedule:
# min hour dom month dow
- cron: '0 5 * * 3'
env:
python_version: '3.13'

jobs:

updater:
name: Update
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
files.pythonhosted.org:443
github.com:443
objects.githubusercontent.com:443
pypi.org:443
raw.githubusercontent.com:443
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: main
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ env.python_version }}
cache: pip
- name: Install pre-commit
run: python -m pip install pre-commit
- name: Update pre-commit hooks
run: pre-commit autoupdate --freeze
- name: Run pre-commit hooks
run: pre-commit run --all-files
- name: Create Pull Request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
token: ${{ secrets.PR_CREATOR }}
commit-message: Update pre-commit hooks
branch: pre-commit-update
delete-branch: true
title: 'Update pre-commit hooks'
body: |
This PR was automatically created to make the following update:
- Update pre-commit hooks
labels: |
skip-changelog

0 comments on commit 87e08a7

Please sign in to comment.