Here are the tips to run a self-runner with gh-cli
- Install gh
- Use PAT with permission below to operate your org/repo
- repo
- workflow
- admin:org
- Need to run
gh auth login
- Now you can start to use gh-cli in your self-runner
Make sure you:
- Add secrets.MY_PAT in org/repo settings
--hostname git.mycompany.com
is your domain
name: Weekly Report |
Here are every type of error if you set it wrong or miss some steps
HTTP 401: This endpoint requires you to be authenticated. (https://git.mycompany.com/api/graphql) |
could not determine base repo: fatal: not a git repository (or any parent up to mount point /) |
/runner/_work/_temp/4e6ad363-9482-4dc1-8edd-a3ff80577dae.sh: line 1: gh: command not found |
HTTP 401: This endpoint requires you to be authenticated. (https://git.mycompany.com/api/graphql) |
The value of the GH_TOKEN environment variable is being used for authentication. |
error fetching organization projects: Message: Resource not accessible by integration, Locations: [{Line:1 Column:92}] |