mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-01 08:23:16 +08:00
End group in core.group regardless of error thrown
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user