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> {
|
||||
startGroup(name)
|
||||
const result = await fn()
|
||||
endGroup()
|
||||
|
||||
let result: T
|
||||
|
||||
try {
|
||||
result = await fn()
|
||||
} finally {
|
||||
endGroup()
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue