-
Notifications
You must be signed in to change notification settings - Fork 102
40 lines (38 loc) · 1.2 KB
/
74-n8n-integration.yml
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
name: 74 - N8N Integration
on:
workflow_dispatch:
inputs:
name:
description: "Name"
required: false
default: "John Doe"
email:
description: "Email"
required: false
default: "[email protected]"
message:
description: "Message"
required: false
default: "Hello, this is a test message!"
jobs:
n8n-integration:
runs-on: ubuntu-latest
steps:
- name: Send POST request to N8N workflow using cURL to open an issue on this repository
env:
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
echo "Workflow URL: $WORKFLOW_URL"
curl -X POST https://${{secrets.N8N_ACCOUNT}}.app.n8n.cloud/webhook/${{ secrets.N8N_PATH}} \
-H "Content-Type: application/json" \
-d '{
"name": "${{ inputs.name }}",
"email": "${{ inputs.email }}",
"message": "${{ inputs.message }}",
"workflow_url": "${{ env.WORKFLOW_URL }}"
}' \
--fail --show-error
if [ $? -ne 0 ]; then
echo "Error: cURL request failed."
exit 1
fi