Github cli in Action not running workflow

1k Views Asked by At

Trying to setup a scheduled workflow that triggers a workflow with particular settings on different branches (which for us equates to different projects)

- run: |
      gh workflow run 'full_branch_manual.yml' -F RunTests=true -F ValidateOnly=true  -r ${{matrix.TARGET_BRANCH}}
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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 (https://docs.github.com/en/actions/using-workflows/using-github-cli-in-workflows) 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?

1

There are 1 best solutions below

0
On

I can confirm that using a Personal Access Token did work

 env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN_PAT }}