-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (75 loc) · 2.08 KB
/
ci.yml
File metadata and controls
93 lines (75 loc) · 2.08 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
test:
name: Test Action
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Type Check
run: npx tsc --noEmit
- name: Test
run: npm test
- name: Build
run: npm run build
- name: Check Build Output
run: |
if [ ! -f "dist/index.js" ]; then
echo "Build failed - dist/index.js not found"
exit 1
fi
echo "✅ Build successful - dist/index.js created"
test-action:
name: Test Action Integration
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test CodeThreat Action (Dry Run)
uses: ./
with:
api-key: 'test-key'
wait-for-completion: false
upload-sarif: false
verbose: true
continue-on-error: true # Expected to fail with test key
package:
name: Package Release
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Build for Release
run: npm run package
- name: Commit Built Files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add dist/
git diff --staged --quiet || git commit -m "Update built action [skip ci]"
git push