mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-11 19:56:03 +00:00
fix(ci): show pre-commit output easily on failure
Right now, the failed Step which is opened by GH by default tells me to just go up and click and scroll through for no reason.
This commit is contained in:
parent
77c8bc6fa7
commit
a8c67f075a
1 changed files with 10 additions and 4 deletions
14
.github/workflows/pre-commit.yml
vendored
14
.github/workflows/pre-commit.yml
vendored
|
|
@ -52,17 +52,23 @@ jobs:
|
||||||
|
|
||||||
- name: Run pre-commit
|
- name: Run pre-commit
|
||||||
id: precommit
|
id: precommit
|
||||||
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
|
run: |
|
||||||
continue-on-error: true
|
set +e
|
||||||
|
pre-commit run --all-files --show-diff-on-failure 2>&1 | tee precommit.log
|
||||||
|
status=${PIPESTATUS[0]}
|
||||||
|
echo "status=$status" >> $GITHUB_OUTPUT
|
||||||
|
exit 0
|
||||||
env:
|
env:
|
||||||
SKIP: no-commit-to-branch,mypy
|
SKIP: no-commit-to-branch,mypy
|
||||||
RUFF_OUTPUT_FORMAT: github
|
RUFF_OUTPUT_FORMAT: github
|
||||||
|
|
||||||
- name: Check pre-commit results
|
- name: Check pre-commit results
|
||||||
if: steps.precommit.outcome == 'failure'
|
if: steps.precommit.outputs.status != '0'
|
||||||
run: |
|
run: |
|
||||||
echo "::error::Pre-commit hooks failed. Please run 'pre-commit run --all-files' locally and commit the fixes."
|
echo "::error::Pre-commit hooks failed. Please run 'pre-commit run --all-files' locally and commit the fixes."
|
||||||
echo "::warning::Some pre-commit hooks failed. Check the output above for details."
|
echo ""
|
||||||
|
echo "Failed hooks output:"
|
||||||
|
cat precommit.log
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
- name: Debug
|
- name: Debug
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue