Skip to content

Commit 553ad61

Browse files
committed
feat(ci): add quality and security workflows with PR comments
- Add CI workflow with Biome lint/format, TypeScript check, tests, build - Add dependency audit with bun pm scan - Add Semgrep SAST with auto and OWASP Top 10 rules - Add CodeQL analysis for JavaScript/TypeScript - Add dependency review action with PR comments - Update mise.toml build output to ralph-for-kiro
1 parent 8aca8b3 commit 553ad61

3 files changed

Lines changed: 141 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
checks: write
13+
14+
jobs:
15+
quality:
16+
name: Quality Checks
17+
runs-on: ubuntu-latest
18+
container:
19+
image: oven/bun:latest
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Install dependencies
26+
run: bun install --frozen-lockfile
27+
28+
- name: Lint (Biome)
29+
run: bunx biome check src tests
30+
31+
- name: Format Check (Biome)
32+
run: bunx biome format src tests
33+
34+
- name: Type Check (TypeScript)
35+
run: bunx tsc --noEmit
36+
37+
- name: Test
38+
run: bun test
39+
40+
- name: Build
41+
run: bun run build
42+
43+
dependency-audit:
44+
name: Dependency Audit
45+
runs-on: ubuntu-latest
46+
container:
47+
image: oven/bun:latest
48+
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v4
52+
53+
- name: Install dependencies
54+
run: bun install --frozen-lockfile
55+
56+
- name: Scan dependencies for vulnerabilities
57+
run: bun pm scan

.github/workflows/security.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Security
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: '0 6 * * 1' # Weekly on Monday at 6am UTC
10+
11+
permissions:
12+
contents: read
13+
security-events: write
14+
pull-requests: write
15+
actions: read
16+
17+
jobs:
18+
semgrep:
19+
name: Semgrep SAST
20+
runs-on: ubuntu-latest
21+
container:
22+
image: semgrep/semgrep
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Run Semgrep (Auto)
29+
run: semgrep scan --config auto --sarif --output semgrep-auto.sarif src
30+
continue-on-error: true
31+
32+
- name: Run Semgrep (OWASP Top 10)
33+
run: semgrep scan --config p/owasp-top-ten --sarif --output semgrep-owasp.sarif src
34+
continue-on-error: true
35+
36+
- name: Upload Semgrep Auto results to GitHub Security
37+
uses: github/codeql-action/upload-sarif@v3
38+
with:
39+
sarif_file: semgrep-auto.sarif
40+
category: semgrep-auto
41+
if: always()
42+
43+
- name: Upload Semgrep OWASP results to GitHub Security
44+
uses: github/codeql-action/upload-sarif@v3
45+
with:
46+
sarif_file: semgrep-owasp.sarif
47+
category: semgrep-owasp
48+
if: always()
49+
50+
codeql:
51+
name: CodeQL Analysis
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v4
57+
58+
- name: Initialize CodeQL
59+
uses: github/codeql-action/init@v3
60+
with:
61+
languages: javascript-typescript
62+
queries: security-and-quality
63+
64+
- name: Perform CodeQL Analysis
65+
uses: github/codeql-action/analyze@v3
66+
with:
67+
category: codeql
68+
69+
dependency-review:
70+
name: Dependency Review
71+
runs-on: ubuntu-latest
72+
if: github.event_name == 'pull_request'
73+
74+
steps:
75+
- name: Checkout
76+
uses: actions/checkout@v4
77+
78+
- name: Dependency Review
79+
uses: actions/dependency-review-action@v4
80+
with:
81+
comment-summary-in-pr: always
82+
fail-on-severity: high
83+
warn-on-openssf-scorecard-level: 3

mise.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ run = "bun run src/index.ts"
88

99
[tasks.build]
1010
description = "Build the CLI binary"
11-
run = "bun build src/index.ts --compile --outfile ralph"
11+
run = "bun build src/index.ts --compile --outfile ralph-for-kiro"
1212

1313
[tasks.test]
1414
alias = "t"

0 commit comments

Comments
 (0)