Skip to content

Commit

Permalink
ci: only commit on pre-commit failure
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtro committed Jul 17, 2024
1 parent 6c4f4da commit 5a416cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ jobs:
pre-commit install
- name: Run pre-commit on PR commits
id: pre-commit_results
run: |
jq '.[]' --raw-output <<< '${{steps.changes.outputs.all_files}}' |
# Run pre-commit to lint and format check files that were changed (but not deleted) compared to master.
xargs pre-commit run --files
- name: Apply any pre-commit fixed files
if: ${{ steps.pre-commit_results.outcome == 'failure' }}
# note: this runs "always" or else it's skipped when pre-commit fails
uses: getsentry/action-github-commit@31f6706ca1a7b9ad6d22c1b07bf3a92eabb05632 # v2.0.0
with:
Expand Down
2 changes: 1 addition & 1 deletion src/seer/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import time
import logging
import time

import sentry_sdk
from flask import Flask, jsonify
Expand Down

0 comments on commit 5a416cd

Please sign in to comment.