Repository navigation
7.31.3 keeps making new releases #490
Description
Activity
@zjgoodman can you post your configuration please? Are the commits in your screenshot the full messages that you're releasing with, or is there more to them that isn't shown (like a message body)?
I suspect https://github.com/relekang/python-semantic-release/blob/aad17b0bdaac088b7538d3d3e04622c15ab31e60/semantic_release/vcs_helpers.py#L40 is not producing the same message as your configuration does when PSR commits on a release, so it "thinks" it hasn't found a commit releasing this version. Combined with going back over the history, probably finding your last major release (v2?), taking that as max level bump and bumping major version.
Are you running this in a CI on a cron trigger?
Hi thanks for looking into this!
Are the commits in your screenshot the full messages that you're releasing with, or is there more to them that isn't shown (like a message body)?
The commits do have a body but it's just the default SR body, as shown below.
can you post your configuration please?
Below is the config for SR that I have in my
pyproject.tomlfile.[tool.semantic_release] version_variable = [ "src/myproject/__init__.py:__version__", "pyproject.toml:version" ] branch = "master" build_command = "poetry build" prerelease_tag = "dev" tag_commit = false hvcs = "gitlab" ignore_token_for_push = false upload_to_repository = true repository_name = "artifactory" repository_url = "https://myartifactory.com" upload_to_release = false
Are you running this in a CI on a cron trigger?
No this CI pipeline is triggered by commits. If you commit to the master branch it kicks off a pipeline. So what you're seeing with all these commits is that semantic release is running and determining that a new release should be made, then commits the release, which triggers a new pipeline, which runs semantic release and then the cycle repeats. On previous versions of semantic release, it determines that there's no need to make a new release and so it doesn't commit, so another pipeline doesn't get triggered.
- added a commit that references this issue
on Aug 23, 2022 @zjgoodman - not sure if the tag worked properly - the issue was that trailing newlines in git commit history were breaking a stricter comparison introduced in #488. I've been able to fix this in a test repo - have replicated with your config etc
@bernardcooke53 I can confirm that the fix in 7.31.4 worked and the problem is resolved. Thanks for taking care of this
7.31.3
Not working (as reported in this bug)
debug: Commits found since last release: 22 debug: evaluate_version_bump -> minor debug: get_new_version('14.3.0', '14.3.0', 'minor', False, True) debug: get_new_version -> 14.4.0 debug: get_repository_owner_and_name() debug: get_repository_owner_and_name -> ('myorg/myteam', 'myproject') debug: Running publish on branch master debug: checkout(master) debug: checkout -> Branch 'master' set up to track remote branch 'master' from 'origin'. warning: No operation mode. Should have bumped from 14.3.0 to 14.4.07.31.4
Working as expected
debug: Commits found since last release: 0 debug: get_new_version('14.3.0', '14.3.0', None, False, True) debug: get_new_version -> 14.3.0 debug: get_repository_owner_and_name() debug: get_repository_owner_and_name -> ('myorg/myteam', 'myproject') debug: Running publish on branch master debug: checkout(master) debug: checkout -> Branch 'master' set up to track remote branch 'master' from 'origin'. No release will be made.Reacted by Daniel Thwaites- added a commit that references this issue
on Nov 17, 2022 - added a commit that references this issue
on Jan 15, 2023 - added a commit that references this issue
on Jun 15, 2024

The problem
We noticed today that our CICD generated 10+ new releases
After looking into it we've discovered that the problem is the newest version of SR itself. The current version of SR (7.31.3) keeps making new releases even if we don't push any new commits. Just running it on the clean master branch causes it to make a new release.
The previous version (7.31.2) works as expected
A clear and concise description of what the bug is.
Expected behavior
If I run semantic release without changing any of the code in master then I won't get a release. But the actual behavior is we do get a release. This is not the case for previous versions of SR.
Additional context
Here's the command with debug verbosity