action-gh-release
action-gh-release copied to clipboard
[Question] How to trigger another workflow by the release
I have a second workflow and try to use these on rules to run on a release https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release However doesn't it trigger. What event should be used or is there another way?
I hope I understand the issue you are facing... If your first workflow creates the release (meaning the release exists after the workflow is done). you can do the following in your second workflow:
on:
workflow_run:
workflows: [Release]
types:
- completed
That's what I needed.
I come across the issue today. After some searching, I find:
https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow:
When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs. If you do want to trigger a workflow from within a workflow run, you can use a personal access token instead of GITHUB_TOKEN to trigger events that require a token. You'll need to create a personal access token and store it as a secret.
The issue is pretty confusing and hard to identify without knowing it otherwise.
I suggest mentioning this issue in README, since some other actions rely on the release event to work properly.