Offer a next step from any tool

Goal

Something outside GitHub Actions knows what should happen next: a nightly job, an n8n flow, a monitoring alert, an AI agent. Let it put a button on the work item. People still decide whether to press it, and Cuelight still checks who can.

What you need

  • The report URL and install key from Cuelight settings → Reporting, stored as secrets in the tool you use
  • An action that the offer points at, usually next-only:

Actions

[
  {
    "id": "deploy-staging",
    "label": "Deploy to staging",
    "style": "primary",
    "type": "github_workflow",
    "availability": "next-only",
    "github": {
      "workflow": "deploy.yml",
      "inputs": {
        "environment": "staging",
        "issue_key": "{{issue.key}}",
        "reason": "{{input.reason}}"
      }
    },
    "form": [{ "name": "reason", "label": "Reason", "type": "textarea", "maxLength": 300 }],
    "allow": { "groups": ["qa-team", "developers"] }
  }
]

Workflow

Every tool sends the same request: a POST with the install key as a bearer token.

curl

curl -X POST "$CUELIGHT_REPORT_URL" \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $CUELIGHT_INSTALL_KEY" \
  -d '{"issueKey":"SHOP-142","source":"Nightly build","message":"Build 1187 passed","next":[{"action":"deploy-staging","inputs":{"reason":"Nightly build 1187"}}]}'

n8n

  1. Add an HTTP Request node.
  2. Set Method to POST and URL to your report URL.
  3. Under Authentication, choose Generic Credential Type → Header Auth and create a credential with name Authorization and value Bearer <install key>.
  4. Turn on Send Body, choose JSON, and use:
{
  "issueKey": "{{ $json.issueKey }}",
  "source": "n8n",
  "next": [{ "action": "deploy-staging" }]
}

Python

Standard library only:

import json
import os
import urllib.request

body = {
    "issueKey": "SHOP-142",
    "source": "Release bot",
    "message": "Changelog is ready",
    "next": [{"action": "deploy-staging", "inputs": {"reason": "Changelog approved"}}],
    "expiresInHours": 24,
}
request = urllib.request.Request(
    os.environ["CUELIGHT_REPORT_URL"],
    data=json.dumps(body).encode(),
    headers={
        "Content-Type": "application/json",
        "Authorization": f"Bearer {os.environ['CUELIGHT_INSTALL_KEY']}",
    },
    method="POST",
)
with urllib.request.urlopen(request) as response:
    print(response.status, response.read().decode())

A 202 means the step is on the work item. Anything else comes with a code and a message; see Report API.

What people see

The panel on SHOP-142 shows Deploy to staging under the suggested steps, with "Suggested by Nightly build" and the message. The reason field is already filled in. Pressing it works like any other button: group check, start comment, result.

Variations

  • Several choices. Send up to five steps in next. Pressing an offered step clears only that step.
  • Refresh instead of repeat. Sending the same source, action and inputs again renews the step's expiry instead of adding a copy.
  • Rotate the key. Create a new install key on the Reporting tab stops the old one at once. Update it in every tool that uses it.