workflows/labels: fix running in pull_request context

When running in a pull_request context, the labels job is part of the
currently running workflow - which will never have succeeded, yet.
Apparently it could be failed already, so in this case we take *any*
workflow run, no matter its state.

(cherry picked from commit ed1fc4c6b3)
This commit is contained in:
Wolfgang Walther
2025-06-24 19:34:21 +02:00
committed by github-actions[bot]
parent 770aadc506
commit 3460ac2fbb

View File

@@ -152,7 +152,8 @@ jobs:
...context.repo,
workflow_id: 'pr.yml',
event: 'pull_request_target',
status: 'success',
// In pull_request contexts the workflow is still running.
status: context.payload.pull_request ? undefined : 'success',
exclude_pull_requests: true,
head_sha: pull_request.head.sha
})).data.workflow_runs[0]?.id ??