You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
lightweight tags create no "create event" in github actions #271
thanks for the finding! some questions, how did you find this problem? could you point the GA documentation where they mention lightweight tag don't create events? I couldn't find it.
I have no documentation at hand. But as far as I know, lightweight tags are not "real" objects in git and have also no creation date. You can see this via git for-each-ref where the objecttype of a lightweight tag is commit and for an annotated tag it is tag (also find this in my unit test).
So basically I found this by trying github actions to do something after tag creation (see https://docs.github.com/en/actions/reference/events-that-trigger-workflows#create), but there was no event triggered after commitizen created the "tag". So I just created a dummy annotated tag and my workflow was running - so I came to that conclusion....
@Lee-W I do not really understand how this is working for you:
I have a job running basically the example in your docs:
bump-version:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
name: "Bump version and create changelog with commitizen"
needs:
- build
steps:
- name: Check out
uses: actions/checkout@v2
with:
token: '${{ secrets.GITHUB_TOKEN }}'
fetch-depth: 0
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
The job appears to work fine:
Configuring git user and email...
Runnung cz...
bump: version 0.2.1 → 0.2.2
tag to create: 0.2.2
increment detected: PATCH
Done!
Pushing to branch...
To https://github.com/*/*.git
f76d488..8bdc82d HEAD -> master
* [new tag] 0.2.2 -> 0.2.2
Done.
Activity
fix(commitizen-tools#271): add annotated_tag option to bump
fix(commitizen-tools#271): add annotated_tag option to bump
fix(commitizen-tools#271): add annotated_tag option to bump
fix(commitizen-tools#271): add annotated_tag option to bump
woile commentedon Sep 23, 2020
thanks for the finding! some questions, how did you find this problem? could you point the GA documentation where they mention lightweight tag don't create events? I couldn't find it.
I'll run some tests in to verify it as well 💪
diefans commentedon Sep 23, 2020
I have no documentation at hand. But as far as I know, lightweight tags are not "real" objects in git and have also no creation date. You can see this via
git for-each-refwhere the objecttype of a lightweight tag iscommitand for an annotated tag it istag(also find this in my unit test).So basically I found this by trying github actions to do something after tag creation (see https://docs.github.com/en/actions/reference/events-that-trigger-workflows#create), but there was no event triggered after commitizen created the "tag". So I just created a dummy annotated tag and my workflow was running - so I came to that conclusion....
Lee-W commentedon Sep 23, 2020
We use the following syntax to detect release which might be the reason why we did not encounter such problem.
But I think it's a feature we could have. Thanks for great work 🙂 I'll also run some test to verify it.
diefans commentedon Sep 23, 2020
@Lee-W I do not really understand how this is working for you:
I have a job running basically the example in your docs:
The job appears to work fine:
I also have a debug workflow:
but this gets never triggered after the "tag" is "pushed" via the bump-version job.
woile commentedon Sep 23, 2020
secrets.GITHUB_TOKENwon't trigger another workflow. It's like using[skip ci]in other CI's.You have to use a personal token like here: https://github.com/commitizen-tools/commitizen/blob/master/.github/workflows/bumpversion.yml
I asked the same in the github action discussion board:
https://git.xywcc.community/t/action-does-not-trigger-another-on-push-tag-action/17148/2
Note: for some reason your
PERSONAL_TOKENmust be provided to thecheckoutstep 🤷♂️I think in our case (commitizen) that's why it was failing. Now we are waiting for next release 🤞 hahahha
fix(commitizen-tools#271): add annotated_tag option to bump
diefans commentedon Sep 23, 2020
@woile this explains a lot...
woile commentedon Sep 23, 2020
Yeah I lost a few hairs dealing with it.
The documentation explains how to add a PERSONAL TOKEN, I think we should mention why though.
https://commitizen-tools.github.io/commitizen/tutorials/github_actions/
docs: inform about GITHUB_TOKEN vs PERSONAL_ACCESS_TOKEN in Github ac…
fix(commitizen-tools#271): add annotated_tag option to bump
fix(commitizen-tools#271): add annotated_tag option to bump
feat(commitizen-tools#271): add annotated_tag option to bump
feat(commitizen-tools#271): enable creation of annotated tags when bu…