File tree 3 files changed +18
-5
lines changed
3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -5,24 +5,32 @@ inputs:
5
5
accessToken :
6
6
description : ' access token required to comment on a pr'
7
7
default : ${{ github.token }}
8
+
8
9
fullCoverageDiff :
9
10
description : ' get the full coverage with diff or only the diff'
10
11
default : false
12
+
11
13
runCommand :
12
14
description : ' custom command to get json-summary'
13
15
default : ' npx jest --coverage --coverageReporters="json-summary" --coverageDirectory="./"'
16
+
14
17
delta :
15
18
description : ' Difference between the old and final test coverage'
16
19
default : 100
20
+
17
21
total_delta :
18
22
description : ' Difference between the old and final test coverage at the total level'
19
23
default : null
24
+
20
25
useSameComment :
21
26
description : ' While commenting on the PR update the exisiting comment'
22
27
default : false
28
+
23
29
main-branch-coverage-summary-file-name :
24
30
description : ' file name of main branch summary (master)'
25
31
default : ' develop-coverage-summary.json'
32
+
33
+
26
34
branding :
27
35
color : red
28
36
icon : git-pull-request
Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ export class DiffChecker {
18
18
) {
19
19
const reportNewKeys = Object . keys ( coverageReportNew )
20
20
const reportOldKeys = Object . keys ( coverageReportOld )
21
- const reportKeys = new Set ( [ ...reportNewKeys , ...reportOldKeys ] )
21
+ // const reportKeys = new Set([...reportNewKeys, ...reportOldKeys])
22
+ const reportKeys = new Set ( [ ...reportNewKeys ] )
22
23
23
24
for ( const filePath of reportKeys ) {
24
25
this . diffCoverageReport [ filePath ] = {
Original file line number Diff line number Diff line change @@ -26,24 +26,28 @@ async function run(): Promise<void> {
26
26
const commentIdentifier = `<!-- codeCoverageDiffComment -->`
27
27
const deltaCommentIdentifier = `<!-- codeCoverageDeltaComment -->`
28
28
let totalDelta = null
29
+
29
30
if ( rawTotalDelta !== null ) {
30
31
totalDelta = Number ( rawTotalDelta )
31
32
}
33
+
32
34
let commentId = null
33
- execSync ( commandToRun )
35
+ execSync ( `${ commandToRun } -- --changeSince=origin/develop` )
36
+
34
37
const codeCoverageNew = < CoverageReport > (
35
38
JSON . parse ( fs . readFileSync ( 'coverage-summary.json' ) . toString ( ) )
36
39
)
37
- execSync ( '/usr/bin/git fetch' )
38
- execSync ( '/usr/bin/git stash' )
39
- execSync ( `/usr/bin/git checkout --progress --force ${ branchNameBase } ` )
40
+ // execSync('/usr/bin/git fetch')
41
+ // execSync('/usr/bin/git stash')
42
+ // execSync(`/usr/bin/git checkout --progress --force ${branchNameBase}`)
40
43
41
44
const codeCoverageOld = < CoverageReport > (
42
45
JSON . parse ( fs . readFileSync ( 'develop-coverage-summary.json' ) . toString ( ) )
43
46
)
44
47
const currentDirectory = execSync ( 'pwd' )
45
48
. toString ( )
46
49
. trim ( )
50
+
47
51
const diffChecker : DiffChecker = new DiffChecker (
48
52
codeCoverageNew ,
49
53
codeCoverageOld
You can’t perform that action at this time.
0 commit comments