-
Notifications
You must be signed in to change notification settings - Fork 215
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When running the auto shipit command with the -d (alias for --dry-run), I noticed that the released label and the released comment are still being added PRs.
The root cause seems to be how the independent lerna versioning is handled in the makeRelease auto hook when the --dry-run flag is passed.
Here is the breakdown of what's going on:
- In case of a fixed lerna version (for example,
"version": "11.2.1") themakeReleasehook implicitly returnsundefined. - In case of an independent lerna version (
"version": "independent") and when the --dry-run flag is passed, the hook returns an empty array. - Release information is retrieved.
- In case of a fixed lerna version, the
releasevariable isundefinedresulting in not invoking theafterReleasehook, hence no issue in this case. - In case of an independent lerna version and when the
--dry-runflag is passed, thereleasevariable is an empty array. This results in invoking theafterReleasehook.- The afterRelease hook is then processed in the
releasedplugin. - Through the
addReleased -> addCommentAndLabelcall chain originating fromafterReleasehook we end up with a comment on the PR and thereleasedlabel added to the PR, which is exactly what we observe.
- The afterRelease hook is then processed in the
To Reproduce
Run npx auto shipit -d in a repository with independent lerna versioning.
Expected behavior
The released PR comment and label are not added to the PR.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working