Skip to content

Commit 97e9d0d

Browse files
committed
Add Sansec eComscan workflow
1 parent 2fb1244 commit 97e9d0d

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Sansec eComscan Security Scan
2+
3+
on:
4+
push:
5+
pull_request_target:
6+
workflow_dispatch:
7+
8+
jobs:
9+
run-ecomscan:
10+
# Skip if it's a push event on a PR (it can't access secrets)
11+
if: github.event.pull_request == null || github.event_name != 'push'
12+
name: Run Sansec eComscan
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
pull-requests: read
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
ref: ${{ github.event.pull_request.head.sha }}
23+
persist-credentials: false
24+
25+
- name: Download eComscan
26+
run: wget https://ecomscan.com/downloads/linux-amd64/ecomscan
27+
28+
- name: Fix permissions
29+
run: chmod +x ecomscan
30+
31+
- name: Run eComscan
32+
env:
33+
ECOMSCAN_KEY: ${{ secrets.SANSEC_LICENSE_KEY }}
34+
run: |
35+
output=$(./ecomscan --no-auto-update --skip-database --deep --format=csv .)
36+
if [ -n "$output" ]; then
37+
echo "Security issues found:"
38+
echo "$output"
39+
exit 1
40+
fi

0 commit comments

Comments
 (0)