Closed czernika closed 1 year ago
Your steps are in the wrong order. You're trying to generate the changelog for a tag that is only created in the next step.
You need to first create the next tag (e.g. via the release-action), then generate the changelog, then update the release with the changelog:
- name: Checkout code
uses: actions/checkout@v3
- name: Get Next Semantic Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: master
- name: Create Draft Release
uses: ncipollo/release-action@v1.12.0
with:
prerelease: true
draft: false
commit: ${{ github.sha }}
name: ${{ steps.semver.outputs.next }}
tag: ${{ steps.semver.outputs.next }}
body: '*pending*'
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.semver.outputs.next }}
writeToFile: false
- name: Update Release
uses: ncipollo/release-action@v1.12.0
with:
allowUpdates: true
draft: false
name: ${{ steps.semver.outputs.next }}
tag: ${{ steps.semver.outputs.next }}
body: |
## What's Changed :eyes:
${{ steps.changelog.outputs.changes }}
**Full Changelog**: https://github.com/czernika/tailwindcss-grid-area/compare//${{ steps.semver.outputs.current }}...${{ steps.semver.outputs.next }}
token: ${{ secrets.GITHUB_TOKEN }}
@NGPixel thanks it works
However I need a draft to be created so I have now other issues but they're not related to this one so I will not bother. I guess I'll need to change my workflow. At least I understood what's caused issue with the latest tag) Thanks again!
@NGPixel I ran into this today, but I would argue that my steps are not in the wrong order. I want to bump my version and commit my changelog in a single commit, not require multiple commits. how can I do this when this actions wont allow it?
@jeacott1 This issue has nothing to do with multiple commits... What are you trying to do?
@NGPixel perhaps I misunderstood your previous answer "You're trying to generate the changelog for a tag that is only created in the next step."
my process is this. on PR merge->main I want to bump the version and generate a changelog. I want to commit those changes and tag that commit with the version #. - this works fine except when I'm trying to use this action I'm getting this "Provided tag doesn't match latest tag" error. it should be noted that I'm triggering on pr closed, not tag here, and I'm using a simple
uses: requarks/changelog-action@v1
with:
tag: ${{ github.ref_name }}
where ${{ github.ref_name }} is 'main' in this case.
I'm facing issue that changelog contains changes for previous tag (1.0.6 - 1.0.7) not latest one (1.0.7 - unreleased draft 1.0.8)
This is my release list
Workflow steps
Action passed however it is generates wrong changelist (1.0.6 - 1.0.7)
If I'll set next version as
tag: v1.0.8
or use rangefromTag: v1.0.7 toTag: v1.0.8
it fails