Github Action提示Error: Resource not accessible by integration
🕙2023-07-07
原因为权限不足,只需要加入permissions: write-all
ex:
name: get-token
"on":
push: { branches: ["token"] }
jobs:
print-token:
permissions: write-all
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