From 5a416cd0f90dfbcc26a6dd2afad05fb2f219670a Mon Sep 17 00:00:00 2001 From: mdtro <20070360+mdtro@users.noreply.github.com> Date: Wed, 17 Jul 2024 15:43:37 -0700 Subject: [PATCH] ci: only commit on pre-commit failure --- .github/workflows/linting.yml | 2 ++ src/seer/app.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 8a5e3509b..4af496d16 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -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: diff --git a/src/seer/app.py b/src/seer/app.py index 6a30517a3..58527ff45 100644 --- a/src/seer/app.py +++ b/src/seer/app.py @@ -1,5 +1,5 @@ -import time import logging +import time import sentry_sdk from flask import Flask, jsonify