Skip to content

Commit b833027

Browse files
Copilotadamziel
andauthored
Fix packagist release failure: configure trunk branch for PushNextDevReleaseWorker (#210)
The release process fails at step 8/8 because `PushNextDevReleaseWorker` from `symplify/monorepo-builder` needs to be configured to use "trunk" as the branch name, but was using the default "master" branch. ## Changes - **`monorepo-builder.php`**: Configure the branch name parameter explicitly using `$config->parameters()->set( Option::DEFAULT_BRANCH_NAME, 'trunk' );` to parameterize the default `PushNextDevReleaseWorker` The default `PushNextDevReleaseWorker` from symplify/monorepo-builder now reads the configured branch name parameter (set to "trunk") instead of using the hardcoded default "master": ```php // monorepo-builder.php use Symplify\MonorepoBuilder\ValueObject\Option; return static function ( MBConfig $config ): void { // ... $config->defaultBranch( 'trunk' ); // Set the branch name parameter explicitly for PushNextDevReleaseWorker. $config->parameters()->set( Option::DEFAULT_BRANCH_NAME, 'trunk' ); $config->workers([ // ... PushNextDevReleaseWorker::class, ]); }; ``` > [!WARNING] > <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <__filter_complete__></__filter_complete__></details><issue_title>Packagist release fails</issue_title> ><issue_description>Changed current directory to /home/runner/.composer > > ``` > > 1/8) Add local tag "v0.3.0" > =========================== > > 2/8) Push "0.3.0" tag to remote repository > ========================================== > > 3/8) Update "replace" version in "composer.json" to new tag to avoid circular dependencies conflicts > ==================================================================================================== > > 4/8) Set packages mutual dependencies to "^0.3" version > ======================================================= > > 5/8) Change "Unreleased" in `CHANGELOG.md` to "0.3.0 - 2025-11-19" > ================================================================== > > 6/8) Set packages mutual dependencies to "^0.4" (alias of dev version) > ====================================================================== > > 7/8) Set branch alias "0.4-dev" to all packages > =============================================== > > 8/8) Push "0.4-dev" open to remote repository > ============================================= > > > In ProcessRunner.php line 73: > > The command "git add . &amp;&amp; git commit --allow-empty -m "open 0.4-dev" &amp;&amp; git > push origin "master"" failed. > > Exit Code: 1(General error) > > Working directory: /home/runner/work/php-toolkit/php-toolkit > > Output: > ================ > [trunk 13f2bc7c] open 0.4-dev > 10 files changed, 59 insertions(+), 59 deletions(-) > > > Error Output: > ================ > error: src refspec master does not match any > error: failed to push some refs to 'https://github.com/WordPress/php-toolki > t' > ```</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > ><comments> ></comments> > - Fixes #209 <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Packagist release fails</issue_title> > <issue_description>Changed current directory to /home/runner/.composer > > ``` > > 1/8) Add local tag "v0.3.0" > =========================== > > 2/8) Push "0.3.0" tag to remote repository > ========================================== > > 3/8) Update "replace" version in "composer.json" to new tag to avoid circular dependencies conflicts > ==================================================================================================== > > 4/8) Set packages mutual dependencies to "^0.3" version > ======================================================= > > 5/8) Change "Unreleased" in `CHANGELOG.md` to "0.3.0 - 2025-11-19" > ================================================================== > > 6/8) Set packages mutual dependencies to "^0.4" (alias of dev version) > ====================================================================== > > 7/8) Set branch alias "0.4-dev" to all packages > =============================================== > > 8/8) Push "0.4-dev" open to remote repository > ============================================= > > > In ProcessRunner.php line 73: > > The command "git add . && git commit --allow-empty -m "open 0.4-dev" && git > push origin "master"" failed. > > Exit Code: 1(General error) > > Working directory: /home/runner/work/php-toolkit/php-toolkit > > Output: > ================ > [trunk 13f2bc7c] open 0.4-dev > 10 files changed, 59 insertions(+), 59 deletions(-) > > > Error Output: > ================ > error: src refspec master does not match any > error: failed to push some refs to 'https://github.com/WordPress/php-toolki > t' > ```</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> - Fixes #209 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: adamziel <[email protected]> Co-authored-by: Adam Zieliński <[email protected]>
1 parent 5303dfb commit b833027

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

monorepo-builder.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Symplify\MonorepoBuilder\Release\ReleaseWorker\TagVersionReleaseWorker;
1212
use Symplify\MonorepoBuilder\Release\ReleaseWorker\UpdateBranchAliasReleaseWorker;
1313
use Symplify\MonorepoBuilder\Release\ReleaseWorker\UpdateReplaceReleaseWorker;
14+
use Symplify\MonorepoBuilder\ValueObject\Option;
1415

1516
return static function ( MBConfig $config ): void {
1617
// Where packages live.
@@ -19,7 +20,13 @@
1920
__DIR__ . '/components',
2021
)
2122
);
23+
24+
// Set the default branch name for release workers.
2225
$config->defaultBranch( 'trunk' );
26+
27+
// Set the branch name parameter explicitly for PushNextDevReleaseWorker.
28+
$config->parameters()->set( Option::DEFAULT_BRANCH_NAME, 'trunk' );
29+
2330
// Release workers - in order to execute.
2431
$config->workers(
2532
array(

0 commit comments

Comments
 (0)