-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.22 KB
/
Copy pathvalidate.yml
File metadata and controls
46 lines (39 loc) · 1.22 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
name: validate
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
validate-workflows:
name: validate-workflows
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Validate n8n workflow JSONs
run: node scripts/validate-workflows.js
- name: Hardcoded token grep (defense-in-depth)
run: |
set -e
# Scan the workflow JSONs for any hardcoded secret shapes.
# Only scans workflows/*.json — does NOT scan .github/workflows.
if ! ls workflows/*.json >/dev/null 2>&1; then
echo "No workflow JSONs to scan yet — skipping"
exit 0
fi
if grep -RnE '(ghp_[A-Za-z0-9]{20,}|ntn_[A-Za-z0-9]{20,}|sk-[A-Za-z0-9]{20,}|ApiKey [A-Za-z0-9]{10,})' workflows/*.json; then
echo "::error::Hardcoded token detected in workflows/*.json"
exit 1
fi
echo "No hardcoded tokens found"