Skip to content

Commit

Permalink
ci: add scheduled workflow to update pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mlegner committed Oct 16, 2023
1 parent ab39350 commit 2779197
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Updates

on:
# every Sunday
schedule:
- cron: '14 3 * * 0'
# on demand
workflow_dispatch:

jobs:
pre-commit:
name: "Update pre-commit hooks and run them on all files"
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- run: rustup update stable
- run: cargo install [email protected]
- run: pip install pre-commit
- run: pre-commit autoupdate
- run: pre-commit run --all-files
- uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: chore/update-pre-commit-hooks
title: "chore: update pre-commit hooks"
commit-message: "chore: update pre-commit hooks"
body: Update pre-commit hooks to latest version.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,39 @@ repos:
- "--"
- "--config"
- "group_imports=StdExternalCrate,imports_granularity=Crate,imports_layout=HorizontalVertical"
language: system
language: rust
types: [rust]
pass_filenames: false
- id: cargo-sort
name: cargo-sort
entry: cargo sort
entry: cargo-sort
args: ["-w"]
language: rust
types: [rust]
pass_filenames: false
- id: cargo-check
name: cargo-check
entry: cargo check
language: system
language: rust
types: [rust]
pass_filenames: false
- id: cargo-test
name: cargo-test
entry: cargo test
language: system
language: rust
types: [rust]
pass_filenames: false
- id: clippy
name: clippy
entry: cargo clippy
args: ["--all-features", "--tests", "--", "-D", "warnings"]
language: system
language: rust
types: [rust]
pass_filenames: false
- id: deny
name: cargo-deny
entry: cargo deny
args: ["--all-features", "check"]
language: system
language: rust
types: [rust]
pass_filenames: false

0 comments on commit 2779197

Please sign in to comment.