GitHub Actions - Trigger on a new git tag
Hey y'all!
Over at GitHub Communities (https://github.community) someone asked a great question (https://github.com/orgs/community/discussions/154396).
They have two workflows in a repository. The first workflow triggers when a pull request against the main branch is merged. When it runs, it creates a tag at that point and pushes the tag up to GitHub. The second workflow triggers whenever a new tag is created in the repository and does "whatever".
The catch is, you can't just use GITHUB_TOKEN for all this, because Actions specifically forbids GITHUB_TOKEN from triggering another workflow to run in the same repo. One reason would be to stop an infinite loop.
So instead, you have to use a Personal Access Token, or a token from a GitHub App. Best practice would be to use a token from a GitHub App. So that's the solution I'm showing here in the video.
Let me know what you think.
============================================================
🌐 FIND ME
👉 Blog: https://mickeygousset.com
👉 GitHub: https://github.com/mickeygousset
👉 Twitter: https://twitter.com/mickey_gousset
============================================================