From d692e57c4d28c1c6ffc1fa4d3ebf69c2a031ced4 Mon Sep 17 00:00:00 2001 From: Dominique Hazael-Massieux Date: Wed, 23 Jun 2021 20:02:27 +0200 Subject: [PATCH] feat(deploy/w3c): add Echidna annotation parameter (#89) --- src/deploy-w3c-echidna.ts | 4 +++- src/prepare-deploy.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/deploy-w3c-echidna.ts b/src/deploy-w3c-echidna.ts index d45ec56..3178ede 100644 --- a/src/deploy-w3c-echidna.ts +++ b/src/deploy-w3c-echidna.ts @@ -94,7 +94,8 @@ export default async function main(inputs: Input, buildOutput: BuildResult) { async function publish(input: Input, buildOutput: BuildResult) { const { dest: outputDir, file } = buildOutput; - const { wgDecisionURL: decision, token, cc } = input; + const { wgDecisionURL: decision, token, cc, repository } = input; + const annotation = `triggered by auto-publish spec-prod action on ${repository}`; const tarFileName = "/tmp/echidna.tar"; await sh(`mv ${file} Overview.html`, { cwd: outputDir }); await sh(`tar cvf ${tarFileName} *`, { @@ -107,6 +108,7 @@ async function publish(input: Input, buildOutput: BuildResult) { // command += ` -F "dry-run=true"`; command += ` -F "tar=@${tarFileName}"`; command += ` -F "token=${token}"`; + command += ` -F "annotation=${annotation}"`; command += ` -F "decision=${decision}"`; if (cc) command += ` -F "cc=${cc}"`; diff --git a/src/prepare-deploy.ts b/src/prepare-deploy.ts index 2183d58..c01f1b4 100644 --- a/src/prepare-deploy.ts +++ b/src/prepare-deploy.ts @@ -47,7 +47,7 @@ export async function w3cEchidnaDeployment( inputs: Inputs, githubContext: GitHubContext, ) { - const { event_name: event } = githubContext; + const { event_name: event, repository } = githubContext; if (!shouldTryDeploy(event)) { return false; } @@ -63,7 +63,7 @@ export async function w3cEchidnaDeployment( const cc = inputs.W3C_NOTIFICATIONS_CC; - return { wgDecisionURL, cc, token: token }; + return { wgDecisionURL, cc, token: token, repository }; } function shouldTryDeploy(githubEvent: GitHubContext["event_name"]) {