Skip to content

Commit d5769a6

Browse files
committed
tmp
1 parent 82cb753 commit d5769a6

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ inputs:
2626
description: 'While commenting on the PR update the exisiting comment'
2727
default: false
2828

29-
main-branch-coverage-summary-file-name:
29+
mainBranchCoverageSummaryFileName:
3030
description: 'file name of main branch summary (master)'
3131
default: 'develop-coverage-summary.json'
3232

dist/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -2033,6 +2033,7 @@ function run() {
20332033
const commandToRun = core.getInput('runCommand');
20342034
const delta = Number(core.getInput('delta'));
20352035
const rawTotalDelta = core.getInput('total_delta');
2036+
const mainBranchCoverageSummaryFileName = core.getInput('mainBranchCoverageSummaryFileName');
20362037
const githubClient = github.getOctokit(githubToken);
20372038
const prNumber = github.context.issue.number;
20382039
const branchNameBase = (_a = github.context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.base.ref;
@@ -2047,14 +2048,13 @@ function run() {
20472048
let commentId = null;
20482049
child_process_1.execSync(`${commandToRun}`);
20492050
const codeCoverageNew = (JSON.parse(fs_1.default.readFileSync('coverage-summary.json').toString()));
2050-
// execSync('/usr/bin/git fetch')
2051-
// execSync('/usr/bin/git stash')
2052-
// execSync(`/usr/bin/git checkout --progress --force ${branchNameBase}`)
2053-
const codeCoverageOld = (JSON.parse(fs_1.default.readFileSync('develop-coverage-summary.json').toString()));
2051+
const codeCoverageOld = (JSON.parse(fs_1.default.readFileSync(mainBranchCoverageSummaryFileName).toString()));
20542052
const currentDirectory = child_process_1.execSync('pwd')
20552053
.toString()
20562054
.trim();
2055+
console.log('>>>>>> START DIFF CHECK');
20572056
const diffChecker = new DiffChecker_1.DiffChecker(codeCoverageNew, codeCoverageOld);
2057+
console.log('>>>>>> END DIFF CHECK');
20582058
let messageToPost = `## Test coverage results :test_tube: \n
20592059
Code coverage diff between base branch:${branchNameBase} and head branch: ${branchNameHead} \n\n`;
20602060
const coverageDetails = diffChecker.getCoverageDetails(!fullCoverage, `${currentDirectory}/`);

src/main.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ async function run(): Promise<void> {
1818
const commandToRun = core.getInput('runCommand')
1919
const delta = Number(core.getInput('delta'))
2020
const rawTotalDelta = core.getInput('total_delta')
21+
const mainBranchCoverageSummaryFileName = core.getInput(
22+
'mainBranchCoverageSummaryFileName'
23+
)
2124
const githubClient = github.getOctokit(githubToken)
2225
const prNumber = github.context.issue.number
2326
const branchNameBase = github.context.payload.pull_request?.base.ref
@@ -37,22 +40,21 @@ async function run(): Promise<void> {
3740
const codeCoverageNew = <CoverageReport>(
3841
JSON.parse(fs.readFileSync('coverage-summary.json').toString())
3942
)
40-
// execSync('/usr/bin/git fetch')
41-
// execSync('/usr/bin/git stash')
42-
// execSync(`/usr/bin/git checkout --progress --force ${branchNameBase}`)
4343

4444
const codeCoverageOld = <CoverageReport>(
45-
JSON.parse(fs.readFileSync('develop-coverage-summary.json').toString())
45+
JSON.parse(fs.readFileSync(mainBranchCoverageSummaryFileName).toString())
4646
)
4747

4848
const currentDirectory = execSync('pwd')
4949
.toString()
5050
.trim()
51-
51+
console.log('>>>>>> START DIFF CHECK')
5252
const diffChecker: DiffChecker = new DiffChecker(
5353
codeCoverageNew,
5454
codeCoverageOld
5555
)
56+
console.log('>>>>>> END DIFF CHECK')
57+
5658
let messageToPost = `## Test coverage results :test_tube: \n
5759
Code coverage diff between base branch:${branchNameBase} and head branch: ${branchNameHead} \n\n`
5860
const coverageDetails = diffChecker.getCoverageDetails(

0 commit comments

Comments
 (0)