workflows/labels: add more error context
The original error is kept, but the PR number is printed as well. Makes debugging much easier.
This commit is contained in:
6
.github/workflows/labels.yml
vendored
6
.github/workflows/labels.yml
vendored
@@ -100,6 +100,7 @@ jobs:
|
||||
...prEventCondition
|
||||
},
|
||||
async (response, done) => (await Promise.allSettled(response.data.map(async (pull_request) => {
|
||||
try {
|
||||
const log = (k,v) => core.info(`PR #${pull_request.number} - ${k}: ${v}`)
|
||||
|
||||
log('Last updated at', pull_request.updated_at)
|
||||
@@ -188,9 +189,12 @@ jobs:
|
||||
labels: added
|
||||
})
|
||||
}
|
||||
} catch (cause) {
|
||||
throw new Error(`Labeling PR #${pull_request.number} failed.`, { cause })
|
||||
}
|
||||
})))
|
||||
.filter(({ status }) => status == 'rejected')
|
||||
.map(({ reason }) => core.setFailed(reason))
|
||||
.map(({ reason }) => core.setFailed(`${reason.message}\n${reason.cause.stack}`))
|
||||
)
|
||||
|
||||
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
|
||||
|
||||
Reference in New Issue
Block a user