n8n-sauvegarde/My workflow 3.json

1 line
15 KiB
JSON
Raw Normal View History

2024-10-15 12:15:03 +02:00
{"createdAt":"2024-10-15T10:13:36.913Z","updatedAt":"2024-10-15T10:14:44.637Z","id":"6FWl2946ojNZkURf","name":"My workflow 3","active":false,"nodes":[{"parameters":{"command":"rm -rf /tmp/repo"},"id":"e2e6fe07-03bf-44cd-b62d-0040e7a3be02","name":"Execute Command","type":"n8n-nodes-base.executeCommand","typeVersion":1,"position":[620,380],"notesInFlow":true,"notes":"Suppression /tmp/repo "},{"parameters":{"operation":"clone","repositoryPath":"/tmp/repo","sourceRepository":"={{$node[\"Webhook\"].json[\"body\"][\"repository\"][\"git_ssh_url\"]}}"},"id":"69e8d041-211b-447e-af1d-df5bed3bf3c3","name":"Git","type":"n8n-nodes-base.git","typeVersion":1,"position":[800,380],"alwaysOutputData":true,"notesInFlow":true,"onError":"continueRegularOutput","notes":"Clonage repo dans /tmp/repo"},{"parameters":{"command":"ls /tmp/repo"},"id":"861721c3-d374-41e8-b7c4-2c798a091adc","name":"Execute Command1","type":"n8n-nodes-base.executeCommand","typeVersion":1,"position":[1680,220],"alwaysOutputData":true,"notesInFlow":true,"notes":"Lister fichiers Git"},{"parameters":{"options":{"reset":false}},"id":"d46059fc-c202-41f4-80ff-634bb1883bb2","name":"Loop Over Items","type":"n8n-nodes-base.splitInBatches","typeVersion":3,"position":[260,640],"notesInFlow":true,"notes":"Traite fichier par fichier"},{"parameters":{"fileSelector":"=/tmp/repo/{{$json[\"fileName\"]}}","options":{}},"id":"9ed67374-8de4-4ab2-ad11-657e3be1e675","name":"Read/Write Files from Disk","type":"n8n-nodes-base.readWriteFile","typeVersion":1,"position":[440,720],"notesInFlow":true,"notes":"Lit le fichier"},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict"},"conditions":[{"id":"1b92e512-49fc-47c9-a93e-b80bc1d48f3b","leftValue":"={{ $items(\"Set2\")[0].json.filtre }}","rightValue":"=.{{ $json[\"fileExtension\"] }}|","operator":{"type":"string","operation":"contains"}}],"combinator":"and"},"options":{}},"id":"c7e1d2bb-6c35-465d-8473-a6f198e372af","name":"If","type":"n8n-nodes-base.if","typeVersion":2,"position":[620,720],"notesInFlow":true,"notes":"Extension à traiter ?"},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict"},"conditions":[{"id":"e182d1f3-0b86-4a38-951e-4eac8bfd025c","leftValue":"={{$node[\"Webhook\"].json[\"body\"][\"commits\"][0][\"message\"]}}","rightValue":"@inspectALL","operator":{"type":"string","operation":"contains"}}],"combinator":"and"},"options":{}},"id":"54181c05-b4d7-4290-8cf9-4fa8f6da2134","name":"If1","type":"n8n-nodes-base.if","typeVersion":2,"position":[1500,380],"notesInFlow":true,"notes":"commit msg =~ @inspectALL"},{"parameters":{"command":"=cd /tmp/repo && git diff-tree --no-commit-id --name-only {{$node[\"Webhook\"].json[\"body\"][\"commits\"][0][\"id\"] }} -r"},"id":"c200a9d3-89ec-414b-adeb-c9d4c00ee18a","name":"Execute Command2","type":"n8n-nodes-base.executeCommand","typeVersion":1,"position":[1680,380],"alwaysOutputData":true,"notesInFlow":true,"notes":"Lister fichiers Git modifiés"},{"parameters":{"jsCode":"const previousResults = $items(\"Set\")[0].json.concatenatedResults;\n\nconst updatedResults = previousResults + \"<h2>\" + $items(\"Code1\")[0].json.filename + \"</h2>\";\n\nreturn [\n {\n json: {\n concatenatedResults: updatedResults\n }\n }\n];"},"id":"4c4ee434-abda-49ab-b9f8-0dbf2bc0834f","name":"Code2","type":"n8n-nodes-base.code","typeVersion":2,"position":[1840,720],"notesInFlow":true,"notes":"Concatène résultat Variable"},{"parameters":{"assignments":{"assignments":[{"id":"085cb216-3d10-4001-b426-671666827470","name":"consigne","value":"={{ $json[\"consigne\"] }}","type":"string"},{"id":"ce95566b-edbd-4da2-8325-f3426dce8dd8","name":"filtre","value":"={{ $json[\"filtre\"] }}","type":"string"}]},"options":{}},"id":"14a6ea1c-bd45-41f3-9f8a-5bf778719302","name":"Set2","type":"n8n-nodes-base.set","typeVersion":3.3,"position":[1320,380],"notesInFlow":true,"notes":"Consigne à \"\""},{"parameters":{"fileSelector":"/tmp/repo/.iacicd","options":{"dataPropertyName":"consigne"}},"id":"8f0ce1a9-d8b1-4e44-b105-4cd658d3b1f7"