Skip to content

Bug: --no-tag is not working as expected with version command #1304

Closed

Description

@spaceone

I would like to see the changelog entry of the next upcoming release.

I tried:

semantic-release version --no-push --skip-build --changelog --no-tag --no-commit
git diff CHANGELOG.md
git checkout CHANGELOG.md

first it failed with:
branch 'feat/pagination' isn't in any release groups; no release will be made

OK, then i allowed branches = feat/*.

Then --no-commit will not only not commit the changelog but actually won't create any at all.
Removing it, and running with --no-tag created the tag nevertheless!

semantic-release, version 10.2.0

Activity

  1. added
    featureA new feature or a feature request
    triagewaiting for initial maintainer review
    on Aug 3, 2025
  2. added and removed
    featureA new feature or a feature request
    triagewaiting for initial maintainer review
    on Aug 4, 2025
  3. changed the title [-]feat: preview of next changelog entry[/-] [+]How do I preview the next changelog entry[/+] on Aug 4, 2025
  4. changed the title [-]How do I preview the next changelog entry[/-] [+]How do I preview the next changelog entry?[/+] on Aug 4, 2025
  5. codejedi365 commented on Aug 4, 2025

    @codejedi365
    Contributor

    Please use the Bug or Question template and fill out the set template fields next time. It saves me time in diagnosing the problem and providing a solution.

    semantic-release version --no-push --skip-build --changelog --no-tag --no-commit

    This command is correct, although you don't need the --no-push because you have --no-tag & --no-commit. It will also perform a version stamp into the codebase as well (this you can't turn off at this time).

    If you are using the PSR-provided template then the following command will essentially update the changelog file for preview. Just note that the title Unreleased will be the next version heading instead.

    semantic-release changelog

    Then --no-commit will not only not commit the changelog but actually won't create any at all. Removing it, and running with --no-tag created the tag nevertheless!

    I think this was a mistake in your environment. I don't have your configuration to review but if you are using the semantic_release.changelog.mode = 'update' (the default in v10) then you need to check to see if you have the semantic_release.changelog.insertion_flag value present in the changelog. Generally, if you do not see a change in the changelog upon version bump, the insertion flag was not found. It has nothing to do with the --no-commit cli switch.

    Removing the --no-commit cli switch would not create a tag if you used the --no-tag switch but it will make a version commit. It will also attempt to push if it made a commit.

  6. spaceone commented on Aug 4, 2025

    @spaceone
    Author

    Hello :-)

    semantic-release changelog

    Okay, this is what I needed. Best would be to have a --diff or --noop flag there, which just prints the git diff that would have been done.

    I figured out, why the change was not displayed by semantic-release version --no-push --skip-build --changelog --no-tag --no-commit - it was added into staging. So git diff didn't show, but git diff --staged did.

    The bug with --no-tag still exists, I can reproduce it.
    The config is here.
    It includes update mode and correct insertation flag.

    $ semantic-release version --no-push --skip-build --changelog --no-tag
    [14:24:30] WARNING  Token value is missing!                                                                                                                                                                                       config.py:779
    0.4.0
    The next version is: 0.4.0! 🚀
    Skipping build due to --skip-build flag
    $ git show
    commit 8caee384ea23f7b35260f874c8e736aa538054de (HEAD -> feat/controls, tag: v0.4.0)
    Author: semantic-release <...>
    Date:   Mon Aug 4 14:24:30 2025 +0200
    
        chore(release): publish 0.4.0
    
    diff --git CHANGELOG.md CHANGELOG.md
    index c43ddfa..f446702 100644
    --- CHANGELOG.md
    +++ CHANGELOG.md
    @@ -2,6 +2,17 @@
     
     <!-- version list -->
     
    +## v0.4.0 (2025-08-04)
    + …
  7. added
    triagewaiting for initial maintainer review
    and removed on Aug 6, 2025
  8. added
    bugSomething isn't working properly
    and removed
    triagewaiting for initial maintainer review
    on Sep 13, 2025
  9. added a commit that references this issue on Sep 13, 2025
    11262d2
  10. added a commit that references this issue on Sep 13, 2025
    b090fa2
  11. changed the title [-]How do I preview the next changelog entry?[/-] [+]Bug: `--no-tag` is not working as expected with version command[/+] on Sep 13, 2025
  12. codejedi365 commented on Sep 13, 2025

    @codejedi365
    Contributor

    🎉 This issue has been resolved in v10.4.1 🎉

    You can find more information about this release on the GitHub Releases page.

    If your issue persists, please reply here and we will re-open the ticket. If you receive a new error, please open a new issue and reference this ticket there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working properly

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions