better logging

This commit is contained in:
Henri Maurer
2023-06-14 10:24:40 +01:00
parent c3c3c2e746
commit 5573b58443
3 changed files with 28 additions and 17 deletions
+15 -9
View File
@@ -35,15 +35,21 @@ async function getComparison(
baseRef,
headRef
})
if (
retryOpts !== undefined &&
comparison.snapshot_warnings.trim() !== '' &&
retryOpts.retryUntil > Date.now()
) {
core.info(comparison.snapshot_warnings)
core.info(`Retrying in ${retryOpts.retryDelay} seconds...`)
await delay(retryOpts.retryDelay * 1000)
return getComparison(baseRef, headRef, retryOpts)
if (retryOpts !== undefined && comparison.snapshot_warnings.trim() !== '') {
if (retryOpts.retryUntil > Date.now()) {
core.info(
`Retry timeout exceeded. Snapshot warnings still present: ${comparison.snapshot_warnings}.`
)
core.info('Proceeding...')
return comparison
} else {
core.info(comparison.snapshot_warnings)
core.info(
`Retrying in ${retryOpts.retryDelay} seconds... To disable retries on snapshot warnings, set retry-on-snapshot-warnings to false.`
)
await delay(retryOpts.retryDelay * 1000)
return getComparison(baseRef, headRef, retryOpts)
}
}
return comparison
}