Skip to content

Commit

Permalink
fix: use correct hpc path
Browse files Browse the repository at this point in the history
  • Loading branch information
Jabolol committed Dec 6, 2024
1 parent cd2653d commit 9ba50eb
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions scripts/publish-coverage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference lib="dom" />

import { $ } from "npm:zx";
import puppeteer from "npm:puppeteer";
import puppeteer from "https://deno.land/x/puppeteer@16.2.0/mod.ts";

const WEBHOOK_URL = Deno.args[0];
const CHROME_PATH = Deno.args[1];
Expand All @@ -27,7 +27,7 @@ const browser = await puppeteer.launch({

const page = await browser.newPage();

await page.goto(`file://${hpcRootPath.stdout.trim()}`);
await page.goto(`file://${Deno.cwd()}/${hpcRootPath.stdout.trim()}`);

const { width, height } = await page.evaluate(() => {
const body = document.body;
Expand Down Expand Up @@ -59,10 +59,21 @@ await browser.close();

const form = new FormData();

const gitCommitHash = (await $`git rev-parse HEAD`).stdout.trim();

form.append(
"payload_json",
JSON.stringify({
content: `\`\`\`md\n# HPC test report\n\`\`\``,
embeds: [
{
title: "HPC Test Report",
description: `\`\`\`md\n# ${gitCommitHash}\n\`\`\``,
image: {
url: "attachment://coverage.png",
},
color: 0x36393f,
},
],
}),
);

Expand All @@ -85,3 +96,5 @@ if (!req.ok) {
),
});
}

await $`rm coverage.png`;

0 comments on commit 9ba50eb

Please # to comment.