Add optional 'conclusion' argument to emitTelemetry

If present, will include the value of `conclusion` with the telemetry
POST body (gh/gh needs a separate PR to recognize this)
This commit is contained in:
Jess Bees
2022-09-14 17:14:40 -04:00
parent c2379ec5e7
commit 1c52af2b34
9 changed files with 679 additions and 3021 deletions

View File

@@ -22,11 +22,12 @@ async function emitTelemetry() {
// All variables we need from the runtime are set in the Deployment constructor
const deployment = new Deployment()
const telemetryUrl = `${deployment.githubApiUrl}/repos/${deployment.repositoryNwo}/pages/telemetry`
core.info(`Sending telemetry for run id ${deployment.workflowRun}`)
const conclusion = core.getInput('conclusion') || null
core.info(`Sending telemetry for run id ${deployment.workflowRun}: ${conclusion}`)
await axios
.post(
telemetryUrl,
{ github_run_id: deployment.workflowRun },
{ github_run_id: deployment.workflowRun, conclusion },
{
headers: {
Accept: 'application/vnd.github.v3+json',