Github cli in Action not running workflow #26653
-
Trying to setup a scheduled workflow that triggers a workflow with particular settings on different branches (which for us equates to different projects)
But whilst the trigger runs, it fails to trigger the target workflow, it does not mark the triggering workflow with any error. I do notice that it does not output anything in the logs as a result of running the command though. I have checked the doco (Using GitHub CLI in workflows - GitHub Docs) it says it can run any “GitHub CLI command” Note I looked at Reuseable workflows but I cannot see how to specify run the workflow for a particular branch. Anyone managed to achieve this? Or is this blocked to prevent loops? FYI - I posted this question originally on Github cli in Action not running workflow - Stack Overflow |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Have finally tested and confirmed that creating a Personal Access Token and storing that in a Secret, and using that secret for the GITHUB_TOKEN to run the workflow does work. A new workflow is run against the target branch, for whatever user the Personal Access Token was created against. Just make sure it has access to run Workflows when you create the token. |
Beta Was this translation helpful? Give feedback.
-
Hey @TonyWhiteSMS, thanks for coming back and providing an update on your question! Really appreciate you leaving the solution you found for future users that find themselves here 🙇♂️ |
Beta Was this translation helpful? Give feedback.
Have finally tested and confirmed that creating a Personal Access Token and storing that in a Secret, and using that secret for the GITHUB_TOKEN to run the workflow does work. A new workflow is run against the target branch, for whatever user the Personal Access Token was created against. Just make sure it has access to run Workflows when you create the token.