2

I've created a "publish" workflow in new repository that publish my project on new release with this trigger

on: release: types: - created 

In my local machine I created a tag and pushed it:

git tag v0.0.1 main git push origin v0.0.1 

Now I see that my repo contains 1 tag and 1 release, but the workflow did not run.

Why the release trigger did not fire when new release created with the tag?

3
  • Creating a tag doesn't automatically create a release. How was the release created? Commented Apr 7, 2021 at 21:03
  • If you want to trigger the workflow with the git commands you executed, this should work: on: push: tags: - '*' Commented Apr 8, 2021 at 2:02
  • I see... When I push a tag, I see a tag and a release. So I thought that a release was created... Commented Apr 8, 2021 at 7:11

2 Answers 2

3

This is confusing in the GitHub Actions documentation on the "Events that Trigger Workflows." https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release

It states that Activity Types are "published," "unpublished," and "prerelease" but it doesn't tell you how to invoke these activities. You need to create a GitHub "Release" Event by either using the web portal or the gh CLI. Follow this documentation: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository

If that link changes look for the Release button in the GitHub web portal. Just creating a git tag is not enough.

From the gh CLI the command is like: gh release create v1.3.2 --title "v1.3.2 (beta)" --notes "this is a beta release" --prerelease

In short git tag is not the event that triggers a GitHub Release event.

Sign up to request clarification or add additional context in comments.

Comments

1

You're missing an indentation tab:

on: release: types: - created 

Otherwise, your trigger is valid. It should trigger as soon as you create a new release on the github.com console/ui (select a tag + create the release).

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.