-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(release): allow automated git push from version or changelog step #29280
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 3800dca. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 6 targets
Sent with 💌 from NxCloud. |
b283671
to
053742f
Compare
053742f
to
5aff8e2
Compare
@@ -701,11 +701,6 @@ describe('nx release circular dependencies', () => { | |||
|
|||
Would stage files in git with the following command, but --dry-run was set: | |||
git add {project-name}/package.json | |||
|
|||
NX Your filter "{project-name}" matched the following projects: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This a solid improvement, previously the nx release
"meta command" would end up repeating the same project filters because each subcommand was logging it directly as well
|
||
if (shouldCreateWorkspaceRelease && changelogResult.workspaceChangelog) { | ||
if (!hasPushedChanges) { | ||
throw new Error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error is here is a safety fallback, but it shouldn't be possible to reach this point because the invalid combination should be caught upfront during config validation
|
||
hasPushedChanges = true; | ||
throw new Error( | ||
'It is not possible to create a github release for the project without pushing the changes to the remote, please ensure that you have not disabled git push in your nx release config' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error is here is a safety fallback, but it shouldn't be possible to reach this point because the invalid combination should be caught upfront during config validation
Current Behavior
An automated git push only takes place if absolutely necessary, namely when we are creating a github release. The user cannot opt into it occurring automatically when not creating a github release, they need to run git push outside of nx release.
Expected Behavior
An automated git push can be opted into by the user via config or the CLI, for the version or changelog phases. There should be no breaking change,
push
will always default to false on the version subcommand, and default to false for the changelog subcommand except when a github release has been opted into.If a user attempts to disable git push but also enable GitHub releases, this will be reported as invalid upfront during config validation.
Related Issue(s)
Fixes #22073