'Github cli in Action not running workflow

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?



Solution 1:[1]

I can confirm that using a Personal Access Token did work

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tony White