-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (71 loc) · 2.18 KB
/
security.yml
File metadata and controls
86 lines (71 loc) · 2.18 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
name: Security
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
schedule:
- cron: '0 0 * * 1' # Weekly on Monday
jobs:
security:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: 'trivy-results.sarif'
continue-on-error: true
codeql:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ['javascript']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
continue-on-error: true
- name: Check if Advanced Security is enabled
if: failure()
run: |
echo "⚠️ CodeQL analysis failed. This is likely because GitHub Advanced Security is not enabled for this repository."
echo "To enable CodeQL code scanning:"
echo "1. Go to repository Settings > Security & analysis"
echo "2. Enable 'Code scanning' under Code security and analysis"
echo "3. Or upgrade to GitHub Advanced Security if using GitHub Enterprise"
echo ""
echo "For now, the workflow will continue with other security checks."