From 586cc5cc8454a984ff33ece2f80a5678ea967bd8 Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Wed, 14 Jan 2026 11:19:06 +0200 Subject: [PATCH] add n8n flow --- .github/workflows/n8n.yml | 57 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/n8n.yml diff --git a/.github/workflows/n8n.yml b/.github/workflows/n8n.yml new file mode 100644 index 0000000..b48d25f --- /dev/null +++ b/.github/workflows/n8n.yml @@ -0,0 +1,57 @@ +name: Trigger N8N Security Scan + +on: + issue_comment: + types: [created] + +jobs: + trigger-n8n: + if: github.event.issue.pull_request && contains(github.event.comment.body, '/run-security-scan') + runs-on: ubuntu-latest + steps: + - name: Prepare hybrid payload + id: payload + run: | + echo "Building payload.json" + # Ensure overrides is always valid JSON + OVERRIDES='${{ github.event.inputs.overrides }}' + if [ -z "$OVERRIDES" ]; then + OVERRIDES="{}" + fi + + cat < payload.json + { + "htmlUrl": "${{ github.event.issue.html_url }}", + "repo": "${{ github.repository }}", + "owner": "${{ github.repository_owner }}", + "branch": "${{ github.ref_name }}", + "commit": "${{ github.sha }}", + "actor": "${{ github.actor }}", + + "before": "${{ github.event.before || '' }}", + "after": "${{ github.event.after || '' }}", + + "pr": ${{ github.event.pull_request.number || 'null' }}, + "prIssue": ${{ github.event.issue.pull_request.number || 'null' }}, + + "headSha": "${{ github.event.pull_request.head.sha || '' }}", + "headRef": "${{ github.event.pull_request.head.ref || '' }}", + "baseSha": "${{ github.event.pull_request.base.sha || '' }}", + "baseRef": "${{ github.event.pull_request.base.ref || '' }}", + + "cloneUrl": "${{ github.event.repository.clone_url || '' }}", + + "overrides": $OVERRIDES + + } + EOF + + echo "Payload built:" + cat payload.json + + - name: Send payload to n8n webhook + run: | + curl -X POST \ + -H "Content-Type: application/json" \ + -d @payload.json \ + https://pandoras-box.oceanprotocol.io/webhook/66d5c38a-7df7-4106-a8e3-f3070fcb6858