-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to home-brewed pre-commit CI action
Draw inspiration from: * https://github.com/isaak654/sandboxie-docs/blob/6169c206fa9978641dafddf34303404604beaf33/.pre-commit-config.yaml * https://github.com/isaak654/sandboxie-docs/blob/84751989d8fdee890520f116ea9e2ab0ff9f9b53/.github/workflows/action.yml#L59-L87 Signed-off-by: Stavros Ntentos <[email protected]>
- Loading branch information
Showing
2 changed files
with
47 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: pre-commit | ||
|
||
on: | ||
# Triggers the workflow on ALL push or pull request events | ||
# except for the `gh-pages`` branch | ||
push: | ||
branches-ignore: | ||
- gh-pages | ||
pull_request: | ||
branches-ignore: | ||
- gh-pages | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
|
||
- uses: pre-commit/[email protected] | ||
|
||
- name: Commit changes | ||
if: ${{ !cancelled() && failure() }} | ||
shell: bash | ||
run: | | ||
git config --local user.name "pre-commit-ci[bot]" | ||
git config --local user.email "66853113+pre-commit-ci[bot]@users.noreply.github.com" | ||
git commit -m "[pre-commit.ci] auto-fixes from pre-commit hooks" -a | ||
git push origin HEAD:${{ github.head_ref || github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
ci: | ||
autofix_commit_msg: '[pre-commit.ci] auto-fixes from pre-commit hooks' | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
rev: v4.6.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
args: | ||
- --fix=lf | ||
- id: trailing-whitespace | ||
- id: check-added-large-files | ||
args: | ||
- --maxkb=10000 | ||
- id: check-merge-conflict | ||
- id: mixed-line-ending | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
- id: forbid-new-submodules | ||
- id: trailing-whitespace |