Skip to content

Commit

Permalink
Merge pull request #1411 from normano64/patch-1
Browse files Browse the repository at this point in the history
Clear missing DSL timeout to allow danger runner to exit when done
  • Loading branch information
orta authored Dec 7, 2023
2 parents 266c485 + f4133b6 commit ef8d604
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
## Main

<!-- Your comment below this -->
- Clear missing DSL timeout when DSL is found so danger runner can exit faster when done [@normano64]
<!-- Your comment above this -->

## 11.3.0
Expand Down
5 changes: 3 additions & 2 deletions source/commands/danger-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const run = (config: SharedCLI) => async (jsonString: string) => {

d("Got STDIN for Danger Run")
foundDSL = true
clearTimeout(missingDSLTimeout)
const dangerFile = dangerfilePath(program)

// Set up the runtime env
Expand Down Expand Up @@ -85,9 +86,9 @@ nodeCleanup((exitCode: number, signal: string) => {
})

// Add a timeout so that CI doesn't run forever if something has broken.
setTimeout(() => {
const missingDSLTimeout = setTimeout(() => {
if (!foundDSL) {
console.error(chalk.red("Timeout: Failed to get the Danger DSL after 1 second"))
console.error(chalk.red("Timeout: Failed to get the Danger DSL after 10 second"))
process.exitCode = 1
process.exit(1)
}
Expand Down

0 comments on commit ef8d604

Please sign in to comment.