Skip to content

Commit

Permalink
ci: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnAngela committed May 17, 2023
1 parent c0f7669 commit 2415630
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions scripts/fireWebhook/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ if (!process.env.ANN_SERVER_SECRET_API_KEY) {
const exitResult = ["skipped", "cancelled"];
const data = {
success: true,
workflowRunPage: workflowLink,
};
const NEEDS = JSON.parse(process.env.needs);
for (const [job, { result }] of Object.entries(NEEDS)) {
Expand All @@ -35,12 +36,15 @@ for (const [job, { result }] of Object.entries(NEEDS)) {
continue;
}
}
console.info(data.success);
if (data.success) {
const GITHUB_EVENT = await jsonModule.readFile(process.env.GITHUB_EVENT_PATH);
data.headCommitId = GITHUB_EVENT.head_commit.id;
data.headCommitMessage = GITHUB_EVENT.head_commit.message;
data.workflowRunPage = workflowLink;
try {
const GITHUB_EVENT = await jsonModule.readFile(process.env.GITHUB_EVENT_PATH);
startGroup("GITHUB_EVENT");
console.info(JSON.stringify(GITHUB_EVENT, null, 4));
endGroup();
data.headCommitId = GITHUB_EVENT?.head_commit?.id;
data.headCommitMessage = GITHUB_EVENT?.head_commit?.message;
} catch { }
}
const body = Buffer.from(JSON.stringify(data), "utf-8");
console.info("body:", body.toString("base64"));
Expand Down

0 comments on commit 2415630

Please sign in to comment.