RequestError [HttpError]: Resource not accessible by integration from github.rest.actions.createWorkflowDispatch
Describe the bug
When I try to use github.rest.actions.createWorkflowDispatch to trigger a workflow in a different repo of the same organization, I am getting a RequestError [HttpError]: Resource not accessible by integration error.
To Reproduce Steps to reproduce the behavior: https://github.com/daos-stack/argobots/blob/7bad135223a5ecce31217d0d7e787451f5950a1d/.github/workflows/dispatch-test.yaml to trigger https://github.com/daos-stack/daos/blob/cf9dcf70df06ab84e7e03402e3a21e109d336650/.github/workflows/rpm-build-and-test.yml Note that the above workflow is only a PR branch at the moment and not on the repo's master/default branch if that is any consequence.
Expected behavior daos-stack/daos rpm-build-and-test.yml workflow on bmurrell/gha-self-hosted-runner branch should trigger.
Screenshots Not a screenshot, but the result of trying to dispatch the workflow: https://github.com/daos-stack/argobots/actions/runs/3533169328/jobs/5928450378
Desktop (please complete the following information): N/A
Smartphone (please complete the following information): N/A
Additional context Add any other context about the problem here.
I guess this requires use of a PAT as the GITHUB_TOKEN is scoped to a single repository only?
@brianjmurrell yep this would require a PAT if you're triggering workflows on other repositories.
I am trying to trigger a workflow in the same repository, and still getting the "Resource not accessible by integration" error.
bump
If you're trying to trigger a workflow in the same repository, ensure you have actions: write permissions for that workflow job.
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions https://docs.github.com/en/rest/overview/permissions-required-for-github-apps?apiVersion=2022-11-28#repository-permissions-for-actions