mirror of https://github.com/actions/toolkit
End group in core.group regardless of error thrown
parent
8f9992ca17
commit
92e6443cf0
|
@ -159,7 +159,14 @@ export function endGroup(): void {
|
||||||
*/
|
*/
|
||||||
export async function group<T>(name: string, fn: () => Promise<T>): Promise<T> {
|
export async function group<T>(name: string, fn: () => Promise<T>): Promise<T> {
|
||||||
startGroup(name)
|
startGroup(name)
|
||||||
const result = await fn()
|
|
||||||
|
let result: T
|
||||||
|
|
||||||
|
try {
|
||||||
|
result = await fn()
|
||||||
|
} finally {
|
||||||
endGroup()
|
endGroup()
|
||||||
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue