{
  "id": "bGQ3XjWBjCOEVByz",
  "name": " Publish generated HTML as a GitHub Gist and return the shareable URL",
  "tags": [],
  "nodes": [
    {
      "id": "27b9084e-f5ac-4352-a83b-c9ba07fc83f1",
      "name": "Create Gist",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        208,
        208
      ],
      "parameters": {
        "url": "https://api.github.com/gists",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"description\": \"Auto-rendered HTML\",\n  \"public\": false,\n  \"files\": {\n    \"report.html\": {\n      \"content\": {{ JSON.stringify($json.html) }}\n    }\n  }\n} ",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "User-Agent",
              "value": "n8n"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "81a700fe-209e-427a-be64-2094e708420e",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        0,
        208
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "html"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "34b106bf-39de-4aed-86fa-56df8cd1db85",
      "name": "Set URL",
      "type": "n8n-nodes-base.set",
      "position": [
        432,
        208
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1627b23c-18a5-4180-ac01-534e65172481",
              "name": "URL",
              "type": "string",
              "value": "={{ \"https://htmlpreview.github.io/?\" + $json.files[\"report.html\"].raw_url }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "0e4f5280-7cae-4ff2-9407-9b72b5cfeb59",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 520,
        "content": "## Add GitHub API key to \"Create Gist\" node\nFirst, add your API key to the auth header in the create gist node.\n\nThen, you can pass HTML reports into this workflow as the input and receive a URL where the HTML is displayed as the output."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": "zt6t5IiKkPc9Z4Ku",
    "executionOrder": "v1"
  },
  "versionId": "65e95b86-419b-4bda-b178-cec08559b6ee",
  "connections": {
    "Create Gist": {
      "main": [
        [
          {
            "node": "Set URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Create Gist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}