Skip to content

Commit 4af9343

Browse files
committed
ci: Debug ci
1 parent 082f73a commit 4af9343

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tools/scripts/upload-badge.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ process.chdir(join(COVERAGE, outputPath));
1919
const coverage = JSON.parse(readFileSync('coverage-summary.json').toString())
2020
const percentage = coverage['total']['statements']['pct'];
2121

22-
const filename = name
23-
const content = {"schemaVersion":1,"label":"Test Coverage","message":`${percentage}%`,"color":"green","namedLogo":"jest"}
22+
const filename = `${name}.json`
23+
const content = JSON.stringify({"schemaVersion":1,"label":"Test Coverage","message":`${percentage}%`,"color":"green","namedLogo":"jest"})
2424
const body = JSON.stringify({ files: { [filename]: { content } } });
25-
console.log(body);
25+
26+
// process.env['GIST_SECRET'] = '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'
27+
// process.env['GIST_ID'] = '397d521f54660656f2fd6195ec482581'
2628
const gistUrl = new URL(process.env['GIST_ID'], 'https://api.github.com/gists/');
2729
const headers = new Headers([
2830
["Content-Type", "application/json"],
@@ -31,7 +33,7 @@ const headers = new Headers([
3133
["Authorization", `token ${process.env['GIST_SECRET']}`],
3234
]);
3335

34-
console.log(process.env['GIST_SECRET'])
36+
3537

3638
const result = await fetch(gistUrl, {
3739
method: "PATCH",

0 commit comments

Comments
 (0)