-
Notifications
You must be signed in to change notification settings - Fork 622
70 lines (60 loc) · 2.2 KB
/
ci-frontend-lint.yaml
File metadata and controls
70 lines (60 loc) · 2.2 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Frontend Lint (Biome)
on:
push:
branches:
- main
paths:
- "frontend/**"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [main]
paths:
- "frontend/**"
jobs:
biome-ci:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: "2.3.13"
- name: Run Biome CI
id: biome
working-directory: frontend
continue-on-error: true
run: |
biome ci src/ 2>&1 | tee biome-output.txt
echo "exit_code=${PIPESTATUS[0]}" >> $GITHUB_OUTPUT
- name: Generate lint report
if: always()
working-directory: frontend
run: |
echo "## Frontend Lint Report (Biome)" >> biome-report.md
echo "" >> biome-report.md
if [ "${{ steps.biome.outputs.exit_code }}" = "0" ]; then
echo "✅ **All checks passed!** No linting or formatting issues found." >> biome-report.md
else
echo "❌ **Issues found.** Please fix the following problems:" >> biome-report.md
echo "" >> biome-report.md
echo '```' >> biome-report.md
cat biome-output.txt >> biome-report.md
echo '```' >> biome-report.md
echo "" >> biome-report.md
echo "Run \`cd frontend && bun run check:fix\` to auto-fix issues." >> biome-report.md
fi
- name: Render lint report to PR
uses: marocchino/sticky-pull-request-comment@70d2764d1a7d5d9560b100cbea0077fc8f633987 # v3.0.2
if: always() && hashFiles('frontend/biome-report.md') != '' && github.event.pull_request.head.repo.fork == false
with:
header: frontend-lint-results
recreate: true
path: frontend/biome-report.md
- name: Output lint report to job summary
if: always() && hashFiles('frontend/biome-report.md') != ''
run: cat frontend/biome-report.md >> $GITHUB_STEP_SUMMARY
- name: Fail if Biome found issues
if: steps.biome.outputs.exit_code != '0'
run: exit 1