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