Skip to content

Commit

Permalink
feat(deploy/w3c): add Echidna annotation parameter (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
dontcallmedom authored Jun 23, 2021
1 parent cfa5aed commit d692e57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/deploy-w3c-echidna.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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} *`, {
Expand All @@ -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}"`;

Expand Down
4 changes: 2 additions & 2 deletions src/prepare-deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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"]) {
Expand Down

0 comments on commit d692e57

Please sign in to comment.