Skip to content

Commit

Permalink
ci(actions): fix precommit update action
Browse files Browse the repository at this point in the history
  • Loading branch information
smp4 committed Jun 8, 2024
1 parent ff8d449 commit 5899953
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
34 changes: 22 additions & 12 deletions .github/workflows/update-precommit.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
name: Pre-commit auto-update

on:
# every day at midnight
schedule:
- cron: "0 0 * * *"
# on demand
# on demand
workflow_dispatch:

jobs:
upgrade:
uses: browniebroke/github-actions/.github/workflows/pre-commit-autoupdate.yml@v1
secrets:
gh_pat: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
with:
# Inputs listed with their default (all optional)
config_path: ".pre-commit-config.yaml" # path is relative to repository root
python_version: "3.11"
branch_name: "update/pre-commit-hooks"
pull_request_title: "chore(deps): upgrade dependencies"
commit_message: "chore(deps): upgrade dependencies"
auto-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- uses: browniebroke/pre-commit-autoupdate-action@main

- uses: peter-evans/create-pull-request@v6
if: always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-hooks
title: Update pre-commit hooks
commit-message: "chore(deps): update pre-commit hooks"
body: Update versions of pre-commit hooks to latest version.
4 changes: 3 additions & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,6 @@ The fragments will be added to the `CHANGELOG.md` file in the root directory. It
Two actions are pre-configured:

- Auto-update pre-commit hook versions
- Build the docs and publish to GitHub Pages
- Build the docs and publish to GitHub Pages

For the pre-commit action to work, you must give GitHub Actions permission to create pull requests to your repo. You can find this setting in your repository settings under Actions - General - Workflow permissions.

0 comments on commit 5899953

Please sign in to comment.