Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { listChangedFiles } from './git'
import { parseInputs } from './inputs'
import { filterRelevantIssues } from './issues'
import type { PersistedCliFiles } from './persist'
import { printConfig } from './print-config'
import { isPullRequest } from './pull-request'

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

try {
await printConfig(inputs)
core.debug(
`Executing print-config verified code-pushup installed in base branch ${base.ref}`
)
} catch (err) {
core.debug(
`Executing print-config failed, assuming code-pushup not installed in base branch ${base.ref} and skipping comparison - ${err}`
)
return
}

const { jsonFilePath: prevReportPath } = await collect(inputs)
prevReport = await fs.readFile(prevReportPath, 'utf8')
core.debug(`Collected previous report at ${prevReportPath}`)
Expand Down
14 changes: 14 additions & 0 deletions src/print-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { exec } from '@actions/exec'
import type { ActionInputs } from './inputs'

export async function printConfig({
bin,
config,
directory,
silent
}: ActionInputs): Promise<void> {
await exec(bin, [...(config ? [`--config=${config}`] : []), 'print-config'], {
cwd: directory,
silent
})
}