Skip to content

PR labels can be applied too late for opened-event required-label checks #28895

@theletterf

Description

@theletterf

Summary

When creating PRs through gh-aw, labels can be applied late enough that pull_request_target workflows triggered by the initial opened event see the PR as unlabeled and fail required-label checks. This has happened twice recently in elastic/docs-actions.

This does not look like the label-checking action misreading the final PR state. In both cases, the failing run evaluated the PR before the release label was present, and a later run passed once the label existed.

Evidence

Repository: https://github.com/elastic/docs-actions

PR #117

PR: elastic/docs-actions#117

PR #118

PR: elastic/docs-actions#118

Expected behavior

If gh-aw is asked to create a PR with labels, or if it infers/applies labels as part of PR setup, the labels should be applied promptly and reliably enough that normal opened-event checks do not observe a transient unlabeled PR.

Ideally, gh-aw would either:

  • add labels as early as possible immediately after PR creation and wait for that mutation to complete before moving on to slower post-create work, such as requesting reviewers;
  • retry or verify label application before reporting the PR as ready; or
  • document that PR labels are post-create metadata and may not be present when opened workflows run, so repositories can trigger required label checks only on labeled/unlabeled or add their own longer retry loop.

Why this matters

Repositories commonly enforce exactly one release-note or changelog label on PRs. If gh-aw-created PRs are briefly unlabeled, required checks can fail despite the PR eventually ending up in a valid state, creating noisy red checks and occasional manual reruns.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions