Skip to content
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: make exit 0 possible when commits required but missing #984

Merged
merged 3 commits into from Mar 1, 2023
Merged

feat: make exit 0 possible when commits required but missing #984

merged 3 commits into from Mar 1, 2023

Conversation

b12k
Copy link
Contributor

@b12k b12k commented Feb 28, 2023

This PR introduces a possibility to exit with 0 code (success) when requireCommits: true and no commits available.

Why this is handy:

Alongside with this PR #982 it will make release-it a monorepo best friend.

Some times it is OK not to have commits related to a certain workspace. Exit with error may stop the pipeline execution, depending on CI configuration.

This particular feature is inspired by monorepo managed by turborepo where every workspace has a "release": "release-it" npm script in package.json.

When turbo release pipeline is executed failing releases are:

  • terminating pipeline execution
  • preventing execution results to be cached

I my case, right now, a custom script, which checks if there commits that touch a specific workspace, prevents an execution of release-it (not to exit with non zero code).

Its kinda specific use case but I think it can be a great addition to release-it.

@webpro
Copy link
Collaborator

webpro commented Mar 1, 2023

Nice! Love this PR, that process.exit(code) might come in handy more often. Will merge when tests pass.

@webpro webpro merged commit 07255b1 into release-it:master Mar 1, 2023
webpro added a commit that referenced this pull request Mar 1, 2023
* feat: make exit 0 possible when commits required but missing

* fix: removed dummy code

---------

Co-authored-by: Lars Kappert <lars@webpro.nl>
@webpro
Copy link
Collaborator

webpro commented Mar 1, 2023

Apparently I missed a line when fixing conflicts here in the GitHub UI, merged anyway to fix locally and push into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants