workflows/labels: improve logging
Printing the URL to the PR in the logs allows clicking on it directly in the GitHub runner logs for easy reference.
This commit is contained in:
5
.github/workflows/labels.yml
vendored
5
.github/workflows/labels.yml
vendored
@@ -105,6 +105,7 @@ jobs:
|
|||||||
|
|
||||||
log('Last updated at', pull_request.updated_at)
|
log('Last updated at', pull_request.updated_at)
|
||||||
if (new Date(pull_request.updated_at) < cutoff) return done()
|
if (new Date(pull_request.updated_at) < cutoff) return done()
|
||||||
|
log('URL', pull_request.html_url)
|
||||||
|
|
||||||
const run_id = (await github.rest.actions.listWorkflowRuns({
|
const run_id = (await github.rest.actions.listWorkflowRuns({
|
||||||
...context.repo,
|
...context.repo,
|
||||||
@@ -118,7 +119,7 @@ jobs:
|
|||||||
|
|
||||||
// Newer PRs might not have run Eval to completion, yet. We can skip them, because this
|
// Newer PRs might not have run Eval to completion, yet. We can skip them, because this
|
||||||
// job will be run as part of that Eval run anyway.
|
// job will be run as part of that Eval run anyway.
|
||||||
log('Last eval run', run_id)
|
log('Last eval run', run_id ?? '<pending>')
|
||||||
if (!run_id) return;
|
if (!run_id) return;
|
||||||
|
|
||||||
const artifact = (await github.rest.actions.listWorkflowRunArtifacts({
|
const artifact = (await github.rest.actions.listWorkflowRunArtifacts({
|
||||||
@@ -129,7 +130,7 @@ jobs:
|
|||||||
|
|
||||||
// Instead of checking the boolean artifact.expired, we will give us a minute to
|
// Instead of checking the boolean artifact.expired, we will give us a minute to
|
||||||
// actually download the artifact in the next step and avoid that race condition.
|
// actually download the artifact in the next step and avoid that race condition.
|
||||||
log('Artifact expires at', artifact.expires_at)
|
log('Artifact expires at', artifact?.expires_at ?? '<not found>')
|
||||||
if (new Date(artifact.expires_at) < new Date(new Date().getTime() + 60 * 1000)) return;
|
if (new Date(artifact.expires_at) < new Date(new Date().getTime() + 60 * 1000)) return;
|
||||||
|
|
||||||
await artifactClient.downloadArtifact(artifact.id, {
|
await artifactClient.downloadArtifact(artifact.id, {
|
||||||
|
|||||||
Reference in New Issue
Block a user