
GitHub PR Deep-Link & Routing Validator (n8n + ExecuteCommand + GitHub Comment)
Description
Categories
🚀 DevOps
Nodes Used
n8n-nodes-base.setn8n-nodes-base.githubn8n-nodes-base.webhookn8n-nodes-base.functionn8n-nodes-base.executeCommand
PriceGratuit
Views0
Last Updated11/28/2025
workflow.json
{
"id": "lasX9PkmCrv41JNs",
"meta": {
"instanceId": "14e4c77104722ab186539dfea5182e419aecc83d85963fe13f6de862c875ebfa",
"templateCredsSetupCompleted": true
},
"name": "GitHub PR Deep-Link & Routing Validator (n8n + ExecuteCommand + GitHub Comment)",
"tags": [],
"nodes": [
{
"id": "e9665b03-2487-454a-8e9d-7f91d2a2d7bd",
"name": "GitHub PR Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
-440,
20
],
"webhookId": "283c3a0f-15ca-4c8d-9440-6733d37d36a0",
"parameters": {
"path": "validate-pr",
"options": {},
"httpMethod": "POST",
"responseMode": "lastNode"
},
"typeVersion": 1
},
{
"id": "e58f11fb-8185-4964-9bfa-2b4b5422ee3a",
"name": "CONFIG - Variables",
"type": "n8n-nodes-base.set",
"position": [
-240,
20
],
"parameters": {
"values": {
"number": [
{
"name": "pullRequestNumber",
"value": 1
}
],
"string": [
{
"name": "repoUrl",
"value": ""
},
{
"name": "manifestPath",
"value": "deeplink-validator-demo/AndroidManifest.xml"
},
{
"name": "scriptPath",
"value": "deeplink-validator-demo/validate-links.sh"
},
{
"name": "commentMode",
"value": "replace"
},
{
"name": "timeout",
"value": "120"
},
{
"name": "githubToken",
"value": ""
},
{
"name": "branchName",
"value": "main"
},
{
"name": "repositoryFullName",
"value": "reponame"
}
]
},
"options": {}
},
"typeVersion": 1
},
{
"id": "ea82f4d2-26a6-4df3-8103-eb3e346541c1",
"name": "Run Validation Script",
"type": "n8n-nodes-base.executeCommand",
"position": [
-40,
20
],
"parameters": {
"command": "=#!/bin/sh\nrm -rf /tmp/validation\necho \"🔄 Cloning repo: {{ $json.repoUrl }}\"\ngit clone --depth 1 --branch \"{{ $json.branchName }}\" \"{{ $json.repoUrl }}\" /tmp/validation || exit 1\n\nSCRIPT_PATH=\"/tmp/validation/{{ $json.scriptPath }}\"\nMANIFEST_PATH=\"/tmp/validation/{{ $json.manifestPath }}\"\n\necho \"📁 Validating script path:\"\nls -l \"$SCRIPT_PATH\" || exit 1\n\nchmod +x \"$SCRIPT_PATH\" || exit 1\necho \"🚀 Executing: $SCRIPT_PATH $MANIFEST_PATH\"\nsh \"$SCRIPT_PATH\" \"$MANIFEST_PATH\" || {\n echo \"❌ Script execution failed\"\n exit 1\n}\necho \"✅ Script ran successfully\"\n"
},
"typeVersion": 1
},
{
"id": "76521f6f-e0d3-4ccf-84ae-ecb730979b2a",
"name": "Format Markdown",
"type": "n8n-nodes-base.function",
"position": [
160,
20
],
"parameters": {
"functionCode": "const lines = $node[\"Run Validation Script\"].json[\"stdout\"].split(\"\\n\");\nlet table = \"| Deep Link | Status |\\n|-----------|--------|\\n\";\nfor (const line of lines) {\n if (!line.includes(\",\")) continue;\n const [url, status] = line.split(\",\");\n if (!url || !status) continue;\n const icon = status.trim() === \"OK\" ? \"✅\" : \"❌\";\n table += `| ${url.trim()} | ${icon} ${status.trim()} |\\n`;\n}\nreturn [{ json: { markdownResult: table } }];"
},
"typeVersion": 1
},
{
"id": "32999f84-7453-48ba-8f5f-70251fd80335",
"name": "GitHub",
"type": "n8n-nodes-base.github",
"position": [
400,
20
],
"webhookId": "a12cc2e2-24ea-424b-8eeb-4264c4758d17",
"parameters": {
"body": "={{ $json.markdownResult }}",
"owner": {
"__rl": true,
"mode": "name",
"value": "={{ $('CONFIG - Variables').item.json.repositoryFullName.split(\"/\")[0] }}"
},
"operation": "createComment",
"repository": {
"__rl": true,
"mode": "name",
"value": "={{ $('CONFIG - Variables').item.json.repositoryFullName.split(\"/\")[1] }}"
},
"issueNumber": "={{ $('CONFIG - Variables').item.json.pullRequestNumber }}"
},
"credentials": {
"githubApi": {
"id": "Ryy6iiaCANDhpJC5",
"name": "GitHub account 3"
}
},
"typeVersion": 1.1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "8326daf3-a1ba-49b1-a392-4b1522a7f660",
"connections": {
"Format Markdown": {
"main": [
[
{
"node": "GitHub",
"type": "main",
"index": 0
}
]
]
},
"GitHub PR Webhook": {
"main": [
[
{
"node": "CONFIG - Variables",
"type": "main",
"index": 0
}
]
]
},
"CONFIG - Variables": {
"main": [
[
{
"node": "Run Validation Script",
"type": "main",
"index": 0
}
]
]
},
"Run Validation Script": {
"main": [
[
{
"node": "Format Markdown",
"type": "main",
"index": 0
}
]
]
}
}
}