Skip to content

Commit 1561ece

Browse files
author
Sanjeev Singh
committed
also posting message of reducing the test percent
1 parent c7eaf05 commit 1561ece

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

dist/index.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -2065,7 +2065,14 @@ function run() {
20652065
});
20662066
// check if the test coverage is falling below delta/tolerance.
20672067
if (diffChecker.checkIfTestCoverageFallsBelowDelta(delta)) {
2068-
throw Error(`Current PR reduces the test percentage by ${delta}`);
2068+
messageToPost = `Current PR reduces the test coverage percentage by ${delta} for some tests`;
2069+
yield githubClient.issues.createComment({
2070+
repo: repoName,
2071+
owner: repoOwner,
2072+
body: messageToPost,
2073+
issue_number: prNumber
2074+
});
2075+
throw Error(messageToPost);
20692076
}
20702077
}
20712078
catch (error) {

src/main.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ async function run(): Promise<void> {
5757

5858
// check if the test coverage is falling below delta/tolerance.
5959
if (diffChecker.checkIfTestCoverageFallsBelowDelta(delta)) {
60-
throw Error(`Current PR reduces the test percentage by ${delta}`)
60+
messageToPost = `Current PR reduces the test coverage percentage by ${delta} for some tests`
61+
await githubClient.issues.createComment({
62+
repo: repoName,
63+
owner: repoOwner,
64+
body: messageToPost,
65+
issue_number: prNumber
66+
})
67+
throw Error(messageToPost)
6168
}
6269
} catch (error) {
6370
core.setFailed(error)

0 commit comments

Comments
 (0)