|
| 1 | +name: Trigger N8N Security Scan |
| 2 | + |
| 3 | +on: |
| 4 | + issue_comment: |
| 5 | + types: [created] |
| 6 | + |
| 7 | +jobs: |
| 8 | + trigger-n8n: |
| 9 | + if: github.event.issue.pull_request && contains(github.event.comment.body, '/run-security-scan') |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Prepare hybrid payload |
| 13 | + id: payload |
| 14 | + run: | |
| 15 | + echo "Building payload.json" |
| 16 | +
|
| 17 | + cat <<EOF > payload.json |
| 18 | + { |
| 19 | + "repo": "${{ github.repository }}", |
| 20 | + "owner": "${{ github.repository_owner }}", |
| 21 | + "branch": "${{ github.ref_name }}", |
| 22 | + "commit": "${{ github.sha }}", |
| 23 | + "actor": "${{ github.actor }}", |
| 24 | +
|
| 25 | + "before": "${{ github.event.before || '' }}", |
| 26 | + "after": "${{ github.event.after || '' }}", |
| 27 | +
|
| 28 | + "pr": ${{ github.event.pull_request.number || 'null' }}, |
| 29 | + "headSha": "${{ github.event.pull_request.head.sha || '' }}", |
| 30 | + "headRef": "${{ github.event.pull_request.head.ref || '' }}", |
| 31 | + "baseSha": "${{ github.event.pull_request.base.sha || '' }}", |
| 32 | + "baseRef": "${{ github.event.pull_request.base.ref || '' }}", |
| 33 | +
|
| 34 | + "cloneUrl": "${{ github.event.repository.clone_url || '' }}", |
| 35 | +
|
| 36 | + "overrides": ${{ github.event.inputs.overrides }} |
| 37 | + } |
| 38 | + EOF |
| 39 | +
|
| 40 | + echo "Payload built:" |
| 41 | + cat payload.json |
| 42 | +
|
| 43 | + - name: Send payload to n8n webhook |
| 44 | + run: | |
| 45 | + curl -X POST \ |
| 46 | + -H "Content-Type: application/json" \ |
| 47 | + -d @payload.json \ |
| 48 | + https://pandoras-box.oceanprotocol.io/webhook-test/66d5c38a-7df7-4106-a8e3-f3070fcb6858 |
0 commit comments