LifeMate — Personal, Family & Learning Companion
ci: add secret and dependency security gates
davoodmehraban89 committed
Oct 5, 2026 at 08:56 UTC
98b00809e6f7422ac0f55994ac7b5dea6b3fcd58
1 file changed
+22
.github/workflows/ci.yml
+22
@@ -9,6 +9,25 @@ permissions:
9
contents: read
10
11
jobs:
12
+ security:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - name: Reject committed environment files
17
+ run: |
18
+ bad_files=$(find . -type f \( -name '.env' -o -name '.env.*' \) ! -name '.env.example' ! -path './.git/*')
19
+ if [ -n "$bad_files" ]; then
20
+ echo "Committed environment files detected:"
21
+ echo "$bad_files"
22
+ exit 1
23
+ fi
24
+ - name: Scan high-confidence secret patterns
25
+ run: |
26
+ if git grep -I -n -E '(-----BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY-----|AKIA[0-9A-Z]{16}|gh[pousr]_[A-Za-z0-9_]{30,}|sk_live_[A-Za-z0-9]{20,})' -- .; then
27
+ echo "Potential committed secret detected."
28
+ exit 1
29
+ fi
30
+
31
flutter:
32
runs-on: ubuntu-latest
33
defaults:
@@ -58,6 +77,9 @@ jobs:
77
- name: Install backend
78
working-directory: backend
79
run: npm install
80
+ - name: Backend dependency audit
81
+ working-directory: backend
82
+ run: npm audit --audit-level=high
83
- name: Backend tests
84
working-directory: backend
85
run: npm test