I am new to semantic-release and as we use an gitflow-ish approach, I'm happy to have found this plugin here.
So I experimented with it and when the plugin isn't able to successfully back merge master to dev (e.g. because dev branch is ahead), the plugin will log an error but still complete. Thus, the pipeline will succeed.
This feels odd, as the readme explicitly said this would cause a red pipeline.
Expected Behavior
Pipeline should fail or at least let me allow to execute something on fail, not only success.
Steps To Reproduce
My logs after running npx semantic-release
[4:37:08 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ Fetching latest commits from repository at "https://automatic_for_the_people:[secure]@OUR_GITLAB/semantic-release-demo.git".
[4:37:08 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ Performing back-merge into develop branch "development".
[4:37:08 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ Branch is detached. Checking out release branch "master".
[4:37:08 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ Checking out develop branch "development".
[4:37:08 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ Performing backmerge with "merge" strategy.
[4:37:08 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ Loading plugins
[4:37:08 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ Executing "done" step of plugins
[4:37:08 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ Found 0 staged files for back-merge commit
[4:37:08 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ Pushing backmerge to develop branch development
[4:37:08 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ✖ Process aborted due to an error while backmerging a branch.
[4:37:08 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ✖ Error: Command failed with exit code 1: git push https://gitlab-ci-token:[secure]@OUR_GITLAP/semantic-release-demo.git HEAD:development
To https://OUR_GITLAB/semantic-release-demo.git
! [rejected] HEAD -> development (non-fast-forward)
error: failed to push some refs to 'https://OUR_GITLAB/semantic-release-demo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
at makeError (/usr/local/lib/node_modules/@saithodev/semantic-release-backmerge/node_modules/execa/lib/error.js:60:11)
at handlePromise (/usr/local/lib/node_modules/@saithodev/semantic-release-backmerge/node_modules/execa/index.js:118:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
[4:37:08 PM] [semantic-release] › ✔ Completed step "success" of plugin "@saithodev/semantic-release-backmerge"
[4:37:08 PM] [semantic-release] › ✔ Published release 1.2.21 on default channel
You're right. The last change to improve logs maybe caused that.
I restored that behaviour and added an additional exit statement to make sure we exit with an error where we should.
Is there an existing issue for this?
Current Behavior
I am new to semantic-release and as we use an gitflow-ish approach, I'm happy to have found this plugin here.
So I experimented with it and when the plugin isn't able to successfully back merge master to dev (e.g. because dev branch is ahead), the plugin will log an error but still complete. Thus, the pipeline will succeed. This feels odd, as the readme explicitly said this would cause a red pipeline.
Expected Behavior
Pipeline should fail or at least let me allow to execute something on fail, not only success.
Steps To Reproduce
My logs after running
npx semantic-release
Config
Environment
Anything else?
No response