I am making a curl post request from my github workflow (action) to get registration token for a self-hosted runner but I am receiving the following response:
{
"message": "Resource not accessible by integration",
"documentation_url": "https://docs.github.com/rest/reference/actions#create-a-registration-token-for-a-repository"
}
Below is stripped version of my github workflow:
name: get-token
"on":
push: { branches: ["token"] }
jobs:
print-token:
name: print-token
environment: dev
# needs: pre-pkr
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Get registration token
id: getRegToken
run: |
curl -X POST -H \"Accept: application/vnd.github.v3+json\" -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/myprofile/myrepo/actions/runners/registration-token
Eventually I'd wanna pass this token to the ami I am creating with packer build command (next step). I tried above curl request with packer's shell provisioner as well but same response. Unable to figure out if I have to allow some permissions from github ui? Or how else can this be done? Thanks in advance.