Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 'release' event to trigger release workflow #16

Merged
merged 3 commits into from May 13, 2022
Merged

Conversation

bonprosoft
Copy link
Collaborator

@bonprosoft bonprosoft commented Apr 23, 2022

There is a limitation that a workflow cannot trigger a new workflow.
https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow

Currently, a release is created by release-drafter, and that's why the release workflow wasn't triggered for the 0.10.2 tag.

As such, I configured the release workflow to use the workflow_dispatch to publish a new release.
I also removed push.tags trigger as we can use the workflow_dispatch trigger for the manual release as well, but I don't have a strong opinion about that.

@himkt
Copy link
Member

himkt commented Apr 29, 2022

I may miss some context, but let me ask a question: can we use release event to trigger the workflow? Release drafter seemingly creates a pre-release, which makes me wonder if it's possible to trigger the release workflow by release event (with activity == published that is distinguished from releases created by drafter).

🔗 https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release

[updated]

Sorry, I was wrong. To distinguish releases from prereleases, we may need to check github.event.release.prerelease flag instead of activity.

🔗 https://github.community/t/release-prerelease-action-triggers/17275/2

@bonprosoft
Copy link
Collaborator Author

bonprosoft commented Apr 30, 2022

Thank you for your review, @himkt!
I've updated my PR to use the release event as you suggest.

release-drafter creates a release and save it as a draft after a PR is merged, so I don't think we need to distinguish between releases and pre-releases.

@bonprosoft bonprosoft changed the title Use workflow_dispatch to trigger release workflow Use release event to trigger release workflow Apr 30, 2022
@bonprosoft bonprosoft changed the title Use release event to trigger release workflow Use 'release' event to trigger release workflow Apr 30, 2022
@bonprosoft bonprosoft added the chore Refactoring or non bug fixes label Apr 30, 2022
@himkt himkt merged commit 4c41230 into main May 13, 2022
@himkt himkt deleted the configure-dispatch branch May 13, 2022 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Refactoring or non bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants