`publish` doesn't bail when the branch is behind upstream
Describe the bug
When I run yarn lerna publish --conventional-commits -y --no-verify-access in my master branch, and there are commits upstream I get this warning:
lerna WARN EBEHIND Local branch "master" is behind remote upstream origin/master, exiting
but the exit code is still 0. Even when running on CI.
In regular Lerna, this used to return non-0 when run on CI. That feature was introduced in https://github.com/lerna/lerna/commit/5452293. The code to throw the error is in https://github.dev/ghiscoding/lerna-lite/blob/e8d8b68a9e702bfb49db1fce78f6a0539c35988d/packages/version/src/version-command.ts#L196, but afaik there is no way to set this.options.ci
Reproduction
N/A
Lerna config and logs
lerna.json
<!-- Please paste your `lerna.json` here -->
lerna-debug.log
<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->
Environment Info
$ yarn lerna --version
1.0.5
Environment info:
System:
OS: Linux 5.10 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
CPU: (6) arm64 unknown
Binaries:
Node: 14.19.0 - ~/.nvm/versions/node/v14.19.0/bin/node
Yarn: 3.2.0 - /usr/local/bin/yarn
npm: 6.14.16 - ~/.nvm/versions/node/v14.19.0/bin/npm
Utilities:
Git: 2.30.2 - /usr/bin/git
### Used Package Manager
yarn >= 2.x
### Validations
- [X] Follow our [Code of Conduct](https://github.com/ghiscoding/lerna-lite/blob/master/.github/CODE_OF_CONDUCT.md)
- [X] Read the [docs](https://github.com/ghiscoding/lerna-lite#readme).
- [X] Check that there isn't [already an issue](https://github.com/ghiscoding/lerna-lite/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/ghiscoding/lerna-lite/discussions).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
I'm not sure how much help I can provide for this since I don't know the code well enough, but if I look at the code you pointed out well it no longer exist, check lerna index.js and lerna cli doesn't have isCi anywhere, even doing a GitHub full search returns nothing for isCi. Apart from a couple more PRs that I have over Lerna, the code is supposed to be the same. So I wonder when was this code removed from Lerna and which version where you using. I don't mind receiving a PR if you can test it out and that works for you but I personally never used that flag neither --no-verify-access and never publish via CI (I always publish locally) so I won't know how to test this.
EDIT
I found the commit that removed it in Lerna which is this commit and looking at the code I took from Lerna, I seem to be inline with what they have
https://github.com/ghiscoding/lerna-lite/blob/main/packages/core/src/command.ts#L147-L173
So the question would be, does the is-ci lib properly detect your CI or not (according to this ci-info list, not all CI are detected)? because that flag that you mentioned isCi no longer exist and Lerna's author might have forgot to remove complete trace of it and it might be an orphan flag and so you're right in saying that there's no way to set or change ci because according to Lerna commit history, that code got removed
This issue seems to be coming from Lerna's code and was reported in Lerna in this issue #2162, there seems to be a possible solution to read. Give that a try, I'm afraid there isn't much more I can do.
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have the means to take action. Please reach out if you have or find the answers we need so that we can investigate further.