-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.23 KB
/
pre-commit.yml
File metadata and controls
48 lines (41 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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