Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 2, 2025

The Composer branch-alias in composer.json needs to map dev-main/dev-master to the next minor development version after the latest release. This is easily forgotten during releases.

Changes

Workflows

  • reusable-check-branch-alias.yml - Core logic to detect outdated branch aliases and create PRs
  • check-branch-alias.yml - Caller workflow, triggers on release or on-demand
  • Updated sync-workflows.yml to distribute to all WP-CLI repos

Logic

  • Triggers automatically when a release is marked as released
  • Filters git tags to stable releases only: v[0-9]*.[0-9]*.[0-9]*
  • Strips pre-release (-alpha) and build metadata (+build.123)
  • Calculates expected alias: v2.12.02.13.x-dev
  • Uses Composer commands to read and update branch-alias values
  • Handles missing extra.branch-alias structure in composer.json
  • Creates PR when current alias doesn't match expected

Composer Integration

  • Uses composer config extra.branch-alias.<key> to read current value
  • Uses composer config extra.branch-alias.<key> <value> to update value
  • Automatically creates the structure if it doesn't exist

Example

After releasing v2.12.0, if composer.json contains:

{
  "extra": {
    "branch-alias": {
      "dev-main": "2.12.x-dev"
    }
  }
}

Workflow updates to "2.13.x-dev" and creates PR with explanation.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add GHA workflow for checking branch alias</issue_title>
<issue_description>The Composer branch alias should always be updated so that it maps dev-master to the latest x.x.x-dev release, as that can easily be forgotten.

We should add a GitHub Actions workflow that checks a package's branch-alias key in the composer.json file and creates a pull-request with an update if it is not up-to-date.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add GHA workflow for updating branch alias in composer Add automated branch-alias checker workflow Nov 2, 2025
Copilot AI requested a review from swissspidy November 2, 2025 17:19
@swissspidy swissspidy marked this pull request as ready for review November 2, 2025 17:21
@swissspidy swissspidy requested a review from a team as a code owner November 2, 2025 17:21
@swissspidy

This comment was marked as resolved.

This comment was marked as duplicate.

@wojsmol

This comment was marked as resolved.

@swissspidy

This comment was marked as resolved.

@wojsmol

This comment was marked as resolved.

@swissspidy

This comment was marked as resolved.

This comment was marked as resolved.

@schlessera schlessera merged commit 4e30390 into main Dec 12, 2025
12 checks passed
@schlessera schlessera deleted the copilot/add-gha-check-branch-alias branch December 12, 2025 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GHA workflow for checking branch alias

4 participants