Skip to content

Commit a97d8c8

Browse files
authored
Merge 55fef7c into 2fb917c
2 parents 2fb917c + 55fef7c commit a97d8c8

File tree

5 files changed

+57
-2
lines changed

5 files changed

+57
-2
lines changed

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { listChangedFiles } from './git'
1717
import { parseInputs } from './inputs'
1818
import { filterRelevantIssues } from './issues'
1919
import type { PersistedCliFiles } from './persist'
20+
import { printConfig } from './print-config'
2021
import { isPullRequest } from './pull-request'
2122

2223
export async function run(
@@ -65,6 +66,18 @@ export async function run(
6566
await git.checkout(['-f', base.ref])
6667
core.debug(`Switched to base branch ${base.ref}`)
6768

69+
try {
70+
await printConfig(inputs)
71+
core.debug(
72+
`Executing print-config verified code-pushup installed in base branch ${base.ref}`
73+
)
74+
} catch (err) {
75+
core.debug(
76+
`Executing print-config failed, assuming code-pushup not installed in base branch ${base.ref} and skipping comparison - ${err}`
77+
)
78+
return
79+
}
80+
6881
const { jsonFilePath: prevReportPath } = await collect(inputs)
6982
prevReport = await fs.readFile(prevReportPath, 'utf8')
7083
core.debug(`Collected previous report at ${prevReportPath}`)

src/print-config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { exec } from '@actions/exec'
2+
import type { ActionInputs } from './inputs'
3+
4+
export async function printConfig({
5+
bin,
6+
config,
7+
directory,
8+
silent
9+
}: ActionInputs): Promise<void> {
10+
await exec(bin, [...(config ? [`--config=${config}`] : []), 'print-config'], {
11+
cwd: directory,
12+
silent
13+
})
14+
}

0 commit comments

Comments
 (0)