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

Clear missing DSL timeout to allow danger runner to exit when done #1411

Merged
merged 2 commits into from
Dec 7, 2023
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
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"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling: "seconds" now

process.exitCode = 1
process.exit(1)
}
Expand Down