feat: add verbose logging support to CDB script (#96) #59
This file contains hidden or 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
| name: format | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup Pixi | |
| uses: prefix-dev/setup-pixi@v0.9.4 | |
| with: | |
| pixi-version: v0.65.0 | |
| activate-environment: false | |
| cache: true | |
| locked: true | |
| - name: Run check | |
| id: precommit | |
| run: | | |
| pixi run -e dev ci-check | |
| continue-on-error: true | |
| - name: Show diff on failure | |
| if: steps.precommit.outcome == 'failure' | |
| run: | | |
| echo "❌ pre-commit found issues that it auto-fixed." | |
| echo " Please run 'pre-commit run --all-files' locally," | |
| echo " commit the changes, and push again." | |
| echo "" | |
| echo "👇 The required changes are shown below:" | |
| git diff | |
| - name: Fail the job if pre-commit failed | |
| if: steps.precommit.outcome == 'failure' | |
| run: | | |
| echo "pre-commit checks failed." | |
| exit 1 | |
| - name: Auto correct | |
| uses: huacnlee/autocorrect-action@main | |
| with: | |
| args: --lint ./docs |