mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 18:32:23 +08:00
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.
This commit is contained in:
3
.github/workflows/labels.yml
vendored
3
.github/workflows/labels.yml
vendored
@@ -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 ??
|
||||
|
||||
Reference in New Issue
Block a user