-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (69 loc) · 2.19 KB
/
validate.yml
File metadata and controls
80 lines (69 loc) · 2.19 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
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@v6
- name: Setup Node 20
uses: actions/setup-node@v6
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"
- name: bash -n syntax check (all scripts)
run: |
set -e
for f in scripts/*.sh daemon/*.sh; do
[ -f "$f" ] || continue
echo "bash -n $f"
bash -n "$f"
done
- name: shellcheck (scripts/ + daemon/)
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0
with:
severity: warning
scandir: './scripts'
- name: node --check on JS scripts
run: |
set -e
for f in scripts/*.js; do
[ -f "$f" ] || continue
node --check "$f"
done
- name: install-workflows DRY_RUN smoke
env:
DRY_RUN: '1'
GITHUB_TOKEN: fake_gh
MORGEN_KEY: fake_mg
GITHUB_REPO_OWNER: example
GITHUB_REPO_NAME: example-tasks
N8N_API_KEY: fake_n8n
N8N_BASE_URL: https://example.app.n8n.cloud
run: ./scripts/install-workflows.sh