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

Is there a way to get in output just the release-version without the dry-run strings ? #1056

Closed
paolomainardi opened this issue Nov 1, 2023 · 8 comments

Comments

@paolomainardi
Copy link

paolomainardi commented Nov 1, 2023

Hi and many thanks for this great project; I love it.

I am wondering if it is possible to have just the next-release version printed without having to do some bash gymnastic to remove the lines, just to be clear:

❯ release-it --no-git.requireCleanWorkingDir --dry-run --release-version
! git fetch --prune --prune-tags origin
$ git rev-parse --abbrev-ref HEAD
$ git config --get branch.feature/test-release-it.remote
$ git remote get-url origin
! git fetch
$ git rev-parse --abbrev-ref HEAD  [cached]
$ git describe --tags --match=* --abbrev=0
$ git symbolic-ref HEAD
$ git for-each-ref --format="%(upstream:short)" refs/heads/feature/test-release-it
$ git rev-parse --abbrev-ref HEAD  [cached]
$ git config --get branch.feature/test-release-it.remote  [cached]
$ git remote get-url origin  [cached]
! git fetch
$ git rev-parse --abbrev-ref HEAD  [cached]
$ git describe --tags --match=* --abbrev=0  [cached]
$ npx auto-changelog --stdout --commit-limit false --unreleased --template https://raw.githubusercontent.com/release-it/release-it/main/templates/changelog-compact.hbs
0.7.16
@DiyanDev
Copy link

DiyanDev commented Nov 2, 2023

Hi,
You can just remove the --dry-run parameter, this should give you a clean output.
Also you can try running it as a npm script with --silent parameter.

@aecc
Copy link

aecc commented Nov 6, 2023

@DiyanDev it seems like --release-version is broken since recently, that seems to be the reason for the feature request. I actually does the tagging even with the argument.

@paolomainardi
Copy link
Author

Thanks, @aecc i guess the problem is that one, in fact the --dry-run confirms the git commands

@aecc
Copy link

aecc commented Nov 6, 2023

Actually, it happens to me even without the --dry-run. Or maybe I don't understand how it would work.
`~$ git tag
1.0.0
1.0.0-35
1.0.0-39
1.0.1
1.0.2
1.0.3
1.1.0
1.1.0-0

~$ npx release-it --release-version
1.1.1
~$ git tag
1.0.0
1.0.0-35
1.0.0-39
1.0.1
1.0.2
1.0.3
1.1.0
1.1.0-0
1.1.1-0`

I only rely on git tags. Version used: 16.1.5

@aecc
Copy link

aecc commented Nov 6, 2023

it seems like the tag "1.1.1-0" is always wrongly created. Maybe this is a different issue and not related, but it seems like the --release-version is having side-effects, but the documentation says:
Add the --release-version flag to print the next version without releasing anything.

@aecc
Copy link

aecc commented Nov 6, 2023

it seems like npx release-it --release-version actually fetches the tags from the origin, which was unexpected to me. You can ignore my comments.

@webpro
Copy link
Collaborator

webpro commented Nov 11, 2023

$ cat package.json 
{
  "name": "release-it",
  "version": "16.2.1",
  ...
}
$ npx release-it --release-version
16.2.2

It should definitely not create a tag or touch anything.

@webpro
Copy link
Collaborator

webpro commented May 8, 2024

Closing due to inactivity.

@webpro webpro closed this as completed May 8, 2024
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

No branches or pull requests

4 participants