From ed1fc4c6b3561fcef919ac289aaeddba37d112cc Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Tue, 24 Jun 2025 19:34:21 +0200 Subject: [PATCH] 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. --- .github/workflows/labels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 3abf5011a97f..c2b33ef8adba 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -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 ??