This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import jobSummary from "./summary"; | ||
import { rawString, trimIndent } from "./util"; | ||
|
||
/** | ||
* Set the markdown job/step summary and exit immediately. | ||
* @param content The markdown job summary content. | ||
*/ | ||
export function fail(content: string): never; | ||
|
||
/** | ||
* Set the markdown job/step summary and exit immediately. | ||
* @param template The markdown job summary template content. | ||
* @param args The arguments to fill into the template. | ||
*/ | ||
export function fail(template: TemplateStringsArray, ...args: unknown[]): never; | ||
|
||
export function fail( | ||
content: string | TemplateStringsArray, | ||
...args: unknown[] | ||
): never { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const result = "❌ Error:" + trimIndent(content as any, ...(args || [])); | ||
jobSummary(result); | ||
console.error(result); | ||
process.exit(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters