Skip to content

Only run label enforcement workflow on open PRs#76274

Merged
desrosj merged 1 commit intotrunkfrom
fix/dont-run-type-label-enforcement-for-closed-prs
Mar 9, 2026
Merged

Only run label enforcement workflow on open PRs#76274
desrosj merged 1 commit intotrunkfrom
fix/dont-run-type-label-enforcement-for-closed-prs

Conversation

@desrosj
Copy link
Copy Markdown
Member

@desrosj desrosj commented Mar 7, 2026

What?

This adds a conditional check to the "Enforce labels on Pull Request" workflow so it only runs when the PR is in the open state.

Why?

The workflow's purpose is to block merges until a [Type] * label has been added. After the PR is merged, there's no point in running it.

How?

Using the github.event context, the pull_request event payload is available and contains a state property.

@desrosj desrosj self-assigned this Mar 7, 2026
@desrosj desrosj added the [Type] Build Tooling Issues or PRs related to build tooling label Mar 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 7, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: desrosj <desrosj@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 7, 2026

Flaky tests detected in b0bb49c.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/22793056123
📝 Reported issues:

Copy link
Copy Markdown
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @desrosj!

@desrosj desrosj merged commit d410e57 into trunk Mar 9, 2026
47 checks passed
@desrosj desrosj deleted the fix/dont-run-type-label-enforcement-for-closed-prs branch March 9, 2026 11:48
@desrosj desrosj added the Needs Testing Needs further testing to be confirmed. label Mar 9, 2026
@github-actions github-actions bot added this to the Gutenberg 22.8 milestone Mar 9, 2026
@desrosj
Copy link
Copy Markdown
Member Author

desrosj commented Mar 9, 2026

I just tested this after merging by adding the Needs Testing label. Looks like it worked and the job was correctly skipped.

Screenshot 2026-03-09 at 7 50 11 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Testing Needs further testing to be confirmed. [Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants