Skip to content

Conversation

@t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Aug 29, 2025

See the discussion on Slack for more details: https://wordpress.slack.com/archives/C02QB2JS7/p1756287157774339

What?

This PR adds a github.ref validation to prevent unintended SVN commit when publishing the plugin.

Why?

When I ran the 21.5 stable release, I encountered a strange problem where commits were only added to tags and not trunk.

https://github.com/WordPress/gutenberg/actions/runs/17263363144/attempts/1

workflow

After investigation, we found that for some reason github.ref was empty, which caused the newly released version to be determined to be "lower" than the plugin version already released, resulting in should_update_trunk being set to false.

image

This variable should be true when a stable version is released:

image

Maybe I did something wrong in the release process, but we haven't found out the reason yet.

How?

At the beginning of the two jobs, add a new job that checks if the github.ref value is empty. We should investigate why the github.ref can be empty in the first place, but this new job should prevent unintended changelog updates and SVN commits.

validate-github-ref

Testing Instructions

We are not able to test this PR at the moment, but I would like to share this PR with the 21.6 release lead and explain that the workflow has changed slightly.

@t-hamano t-hamano self-assigned this Aug 29, 2025
@t-hamano t-hamano added Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts GitHub Actions Pull requests that update GitHub Actions code labels Aug 29, 2025
@t-hamano t-hamano marked this pull request as ready for review August 29, 2025 07:29
@t-hamano t-hamano requested a review from desrosj as a code owner August 29, 2025 07:30
@github-actions
Copy link

github-actions bot commented Aug 29, 2025

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: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: cbravobernal <cbravobernal@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: desrosj <desrosj@git.wordpress.org>

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

@Mamaduka
Copy link
Member

Mamaduka commented Sep 3, 2025

Let's rebase this to resolve the failing CI check. I'm not an expert when it comes to GH actions, but validation logic looks okay to me.

@t-hamano t-hamano force-pushed the plugin-deploy-ref-check branch from 42c78c3 to 423ac7e Compare September 3, 2025 10:27
@desrosj
Copy link
Member

desrosj commented Sep 3, 2025

I have this on my list and I'm hoping to review today.

@github-actions
Copy link

github-actions bot commented Sep 3, 2025

Flaky tests detected in 423ac7e.
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/17430628965
📝 Reported issues:

Copy link
Contributor

@cbravobernal cbravobernal left a comment

Choose a reason for hiding this comment

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

Let's see how it handles on the next release.

@cbravobernal cbravobernal merged commit dda7d7f into trunk Sep 3, 2025
69 checks passed
@cbravobernal cbravobernal deleted the plugin-deploy-ref-check branch September 3, 2025 11:34
@github-actions github-actions bot added this to the Gutenberg 21.6 milestone Sep 3, 2025
@cbravobernal cbravobernal added the [Type] Build Tooling Issues or PRs related to build tooling label Sep 3, 2025
@github-actions
Copy link

github-actions bot commented Sep 3, 2025

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core, Gutenberg Plugin, New Block.
  • Labels found: [Type] Build Tooling, Gutenberg Plugin, GitHub Actions.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@t-hamano
Copy link
Contributor Author

t-hamano commented Sep 4, 2025

The new release workflow seems to work nicely:

image image

@desrosj, please let us know if there are any improvements we can make to this workflow.

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

Labels

GitHub Actions Pull requests that update GitHub Actions code Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants