pre-commit #5
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: pre-commit | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| pre-commit: | |
| name: Pre-commit Checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| token: ${{ secrets.GH_PAT_SUBMODULE }} | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Type (TypeScript) | |
| id: type | |
| continue-on-error: true | |
| run: bun type | |
| - name: Lint (ESLint) | |
| id: lint | |
| continue-on-error: true | |
| run: bun lint | |
| - name: Format (Prettier) | |
| id: format | |
| continue-on-error: true | |
| run: bun check:format | |
| - name: Aggregate Checks | |
| if: steps.type.outcome == 'failure' || steps.lint.outcome == 'failure' || steps.format.outcome == 'failure' | |
| run: | | |
| echo "One or more pre-commit checks failed:" | |
| if [ "${{ steps.type.outcome }}" == "failure" ]; then | |
| echo "- Type check failed" | |
| fi | |
| if [ "${{ steps.lint.outcome }}" == "failure" ]; then | |
| echo "- Linting failed" | |
| fi | |
| if [ "${{ steps.format.outcome }}" == "failure" ]; then | |
| echo "- Code formatting issues found" | |
| fi | |
| exit 1 |