Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip comparison for initial PR, determined by print-config failing #32

Merged
merged 1 commit into from
Jun 19, 2024
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 { 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 @@
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(

Check warning on line 75 in src/main.ts

View workflow job for this annotation

GitHub Actions / GitHub Actions Test

<↗> Code coverage | Line coverage

Line 75 is not covered in any test case.
`Executing print-config failed, assuming code-pushup not installed in base branch ${base.ref} and skipping comparison - ${err}`
)
return

Check warning on line 78 in src/main.ts

View workflow job for this annotation

GitHub Actions / GitHub Actions Test

<↗> Code coverage | Line coverage

Line 78 is not covered in any test case.
}

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'], {

Check failure on line 10 in src/print-config.ts

View workflow job for this annotation

GitHub Actions / GitHub Actions Test

<↗> Code coverage | Branch coverage

1st branch is not taken in any test case.
cwd: directory,
silent
})
}
Loading