Github actions workflow not triggering with tag push #27028
-
I have a workflow with 2 actions. The first action is triggered when a push is made to the branch and pushes new git tag and the second action is triggered when after a new tag is pushed. However, the second action is not triggering lately even though the tags are being created and pushed into git tags by the first action. Anyone else facing the same issue? I am using the tag based build as below: also used create event. Nothing seems to work
|
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 14 replies
-
Do you have two workflows, one with an action to push new tags and the other be triggered by tag creation ? Which token do you use in the first action to create new tag? There is a limitation of workflow: An action in a workflow run can’t trigger a new workflow run. When you use GITHUB_TOKEN in your actions, all of the interactions with the repository are on behalf of the Github-actions bot. The operations act by Github-actions bot cannot trigger a new workflow run. You can go to releases page to see the user who released a release. I would suggest you use your own PAT when creating tags. You can store your PAT in secrets and use ${{ secrets.PATNAME } in your actions. env: GITHUB_TOKEN: ${{ secrets. PATNAME }} |
Beta Was this translation helpful? Give feedback.
-
Thanks a ton! It worked… |
Beta Was this translation helpful? Give feedback.
-
Is there any possibility of this changing? Adding a PAT to every repo in our organisation is not a good option for two reasons: * We would have to update every single repo anytime we need to roll the token. * If we create a user specifically for this kind of task then we have to pay for an extra seat. |
Beta Was this translation helpful? Give feedback.
-
Is this still a known problem? I’ve got something similar going on, where one action creates a development release tag, and a second action creates packaged executables for releases, but the second action is never run. My releases/tags do have myself as the author, and not the bot. |
Beta Was this translation helpful? Give feedback.
-
It’s still by design, see Using the
Note that this is not about who is the commit or tag author, but how the push is authorized. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply! I should have been a bit clearer. I do use a custom authentication token for the push to push the tag, say |
Beta Was this translation helpful? Give feedback.
-
A such limitation is ‘by design’ ? |
Beta Was this translation helpful? Give feedback.
-
pkernevez:
Deploy Keys offer the solution you’re looking for: they’re repository scoped! I’ve written a complete blog post called Trigger another GitHub Workflow — without using a Personal Access Token but in summary:
Any Git operation performed by your Workflow – e.g: a Push – will trigger Workflows, because GitHub does not restrict Deploy Keys. |
Beta Was this translation helpful? Give feedback.
-
Thanks, it works. |
Beta Was this translation helpful? Give feedback.
-
2023 and can confirm this still does not work.
The only way around this is to use: https://github.com/marketplace/actions/rebuild-stale-pullrequests |
Beta Was this translation helpful? Give feedback.
-
August 2023. Still not working
If I write
then the environment variable
That is, the trigger is called by a branch push, not by a tag |
Beta Was this translation helpful? Give feedback.
-
Oh man, just hit this (Oct 2024!). I have no idea why it would be designed this way, but wow is this inconvenient. Not sure why it matters if a tag comes from me or from another workflow, a tag is a tag, and should trigger any workflows that depend on tags. |
Beta Was this translation helpful? Give feedback.
Do you have two workflows, one with an action to push new tags and the other be triggered by tag creation ? Which token do you use in the first action to create new tag?
There is a limitation of workflow: An action in a workflow run can’t trigger a new workflow run.
When you use GITHUB_TOKEN in your actions, all of the interactions with the repository are on behalf of the Github-actions bot. The operations act by Github-actions bot cannot trigger a new workflow run.
You can go to releases page to see the user who released a release.
I would suggest you use your own PAT when creating tags. You can store your PAT in secrets and use
${{ secrets.PATNAME } in you…