-
Notifications
You must be signed in to change notification settings - Fork 925
chore: update workflow permissions #9869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
@@ -9,8 +9,8 @@ on: | |||
- ".changeset/**.md" | |||
|
|||
permissions: | |||
contents: read | |||
# note: no write permissions are needed since the workflow uses GH_ACCESS_TOKEN instead of GITHUB_TOKEN | |||
contents: write # Required to push the v3 backport branch up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should fix fatal: unable to access 'https://github.com/cloudflare/workers-sdk/': The requested URL returned error: 403
contents: read | ||
# note: no write permissions are needed since the workflow uses GH_ACCESS_TOKEN instead of GITHUB_TOKEN | ||
contents: write # Required to push the v3 backport branch up | ||
pull-requests: write # Required for opening the backport PR and commenting on the original PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should fix Error: Resource not accessible by integration
@@ -45,7 +45,7 @@ jobs: | |||
FILES: ${{ steps.files.outputs.all }} | |||
PR_NUMBER: ${{ github.event.number }} | |||
PR_TITLE: ${{ toJson(github.event.pull_request.title) }} | |||
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | |||
GH_TOKEN: ${{ github.token }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we were using this GH_TOKEN only for creating the PR but I don't see why we can't use the default github token
contents: read | ||
# note: no write permissions are needed since the workflow uses GH_ACCESS_TOKEN instead of GITHUB_TOKEN | ||
contents: read # no write permissions are needed since the workflow uses GH_ACCESS_TOKEN instead of GITHUB_TOKEN | ||
pull-requests: write # Required for creating the draft PR on behalf of the user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for using a different token is that you cannot trigger workflows from other workflows - they just don't run. I think this is to prevent infinite recursion taking down teh system?
So if you want to cause another workflow to run based off a change this one is making, it needs to use a different token to the one provided by GH.
Is that relevant here?
It looks like we can create a PR using the default GitHub token with the |
* chore: update workflow permissions * revert to using a different GH_TOKEN
Fixes n/a.