Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2314eac

Browse files
committedApr 12, 2024
ci:
Fix upload badge
1 parent 229e28f commit 2314eac

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed
 

‎libs/json-rpc/nestjs-json-rpc-sdk/project.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,16 @@
9696
"options": {
9797
"packageRoot": "dist/libs/json-rpc/nestjs-json-rpc-sdk"
9898
}
99-
}
99+
},
100+
"test": {
101+
"executor": "@nx/jest:jest",
102+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
103+
"options": {
104+
"jestConfig": "libs/json-rpc/nestjs-json-rpc-sdk/jest.config.ts",
105+
"codeCoverage": true,
106+
"coverageReporters": ["json-summary"]
107+
}
108+
},
100109
},
101110
"tags": []
102111
}

‎tools/scripts/upload-badge.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,18 @@ const headers = new Headers([
3333

3434

3535
(async function(){
36-
const status = await fetch(gistUrl, {
36+
const [status, bodyResult] = await fetch(gistUrl, {
3737
method: "PATCH",
3838
headers,
3939
body,
40-
}).then(r => r.status)
40+
}).then(r => Promise.all([
41+
r.status, r.json()
42+
]))
4143
if (status === 200) {
42-
console.log('Badge has been updated')
44+
console.log('Badge has been updated: '+ `${percentage}%`)
4345
} else {
4446
console.log(gistUrl.toString());
45-
console.log(JSON.stringify([...headers.entries()]))
47+
console.log(JSON.stringify(bodyResult));
4648
console.warn('Badge has not been updated')
4749
}
4850
})();

0 commit comments

Comments
 (0)
Please sign in to comment.