-
-
Notifications
You must be signed in to change notification settings - Fork 295
Closed
Labels
type: featureA new enhacement proposalA new enhacement proposal
Description
Description
in my case, in gh-actions manually called cz ch
like this, as example:
cz changelog --dry-run 0.2.0a2 > CHANGELOG.txt
and use as body for gh-release .
Example:
$ git tag
v0.1.0
v0.2.0-a0
v0.2.0-a1
v0.2.0-a2
for the prerelease case, I use the current tag, like "0.2.0a2", that's fine.
but for release after all pre-releases i need to collect all commits between releases message like 0.2.0a0..0.2.0
at the moment it looks like this
$ cz ch 0.2.0a0..0.2.0 --dry-run
## v0.2.0 (2023-03-13)
### Fix
- foo fix 3
## v0.2.0b0 (2023-03-13)
## v0.2.0a1 (2023-03-13)
### Fix
- some fix
## v0.2.0a0 (2023-03-13)
### Feat
- super feature
## v0.1.0 (2023-03-13)
Possible Solution
I'm thinking about adding a flag for the merged prerelease commit in one release.
For example, --merge-prerelease
I want something like this:
$ cz ch 0.2.0a0..0.2.0 --dry-run --merge-prerelease
## v0.2.0 (2023-03-13)
### Fix
- foo fix 3
- some fix
### Feat
- super feature
In the case of a multi-release range 0.1.0..0.3.0
, the output would be:
$ cz ch 0.1.0..0.3.0 --dry-run --merge-prerelease
## v0.3.0 (2023-03-13)
### Fix
- foo fix 3
- some fix
### Feat
- super feature
## v0.2.0 (2023-03-13)
### Feat
- feature
## v0.1.0 (2023-03-13)
### Feat
- feature foo
Additional context
This feature useful for gh-actions for me
- name: Check version
uses: apkawa/gh-action-semver-check@master
id: version
- name: Generate Changelog
run: |
cz changelog --dry-run ${{ steps.version.outputs.full_with_prefix }}a0..${{ steps.version.outputs.full_with_prefix }} > ${{ github.workspace }}-CHANGELOG.txt
- name: Publish archives and packages
uses: softprops/action-gh-release@v1
if: ${{ !github.event.schedule && startsWith(github.ref, 'refs/tags') }}
with:
draft: true
prerelease: ${{ needs.version.outputs.prerelease }}
body_path: ${{ github.workspace }}-CHANGELOG.txt
In addition, you may need a special syntax for the range
Instead of 0.2.0a0..0.2.0
there will be, for example, ~0.2.0
. This will make things easier
Additional context
Metadata
Metadata
Assignees
Labels
type: featureA new enhacement proposalA new enhacement proposal
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
Apkawa commentedon Mar 13, 2023
What do you think about this? I'm thinking of making a pull request with this feature.
woile commentedon Mar 18, 2023
I think is a good idea. One question though: do we want to merge-prereleases, or skip empty ones? What do you think would make more sense?
Apkawa commentedon Mar 18, 2023
I think maybe separate flags
--skip-empty-prerelease
, rest of logic as usual.--merge-prerelease
. which is what I wrote above.woile commentedon Apr 28, 2023
Flag has been added.
https://commitizen-tools.github.io/commitizen/changelog/#merge-prerelease