Skip to content

Commit 5909bdd

Browse files
authored
[ci] add more permissions for create-pull-request (#11302)
It seems like create pull request also needs content write permission <img width="1008" height="465" alt="image" src="https://github.com/user-attachments/assets/47d1b179-a887-4723-90ba-736f83ec2c4e" /> https://github.com/marketplace/actions/create-pull-request current workflow error ``` /usr/bin/git push --force-with-lease origin go_router-23310566202-1:refs/heads/go_router-23310566202-1 remote: Permission to flutter/packages.git denied to github-actions[bot]. fatal: unable to access 'https://github.com/flutter/packages/': The requested URL returned error: 403 Error: The process '/usr/bin/git' failed with exit code 128 ``` https://github.com/flutter/packages/actions/runs/23310566202/job/67796535425#step:3:884 ## Pre-Review Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [ ] I read the [Tree Hygiene] page, which explains my responsibilities. - [ ] I read and followed the [relevant style guides] and ran [the auto-formatter]. - [ ] I signed the [CLA]. - [ ] The title of the PR starts with the name of the package surrounded by square brackets, e.g. `[shared_preferences]` - [ ] I [linked to at least one issue that this PR fixes] in the description above. - [ ] I followed [the version and CHANGELOG instructions], using [semantic versioning] and the [repository CHANGELOG style], or I have commented below to indicate which documented exception this PR falls under[^1]. - [ ] I updated/added any relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under[^1]. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. <!-- Links --> [Contributor Guide]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md [relevant style guides]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style [the auto-formatter]: https://github.com/flutter/packages/blob/main/script/tool/README.md#format-code [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md [linked to at least one issue that this PR fixes]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview [the version and CHANGELOG instructions]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#version-and-changelog-updates [semantic versioning]: https://dart.dev/tools/pub/versioning#semantic-versions [repository CHANGELOG style]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changelog-style [test exemption]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
1 parent 371106f commit 5909bdd

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/batch_release_pr.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ jobs:
4545
if: needs.create_batch_release_branch.outputs.branch_created == 'true'
4646
runs-on: ubuntu-latest
4747
permissions:
48-
pull-requests: write # Grants write permission to create a PR.
48+
# The create-pull-request action needs both content and pull-requests permissions.
49+
pull-requests: write
50+
contents: write
4951
env:
5052
BRANCH_NAME: ${{ github.event.client_payload.package }}-${{ github.run_id }}-${{ github.run_attempt }}
5153
steps:

.github/workflows/sync_release_pr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
jobs:
1010
create_sync_pr:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
# The create-pull-request action needs both content and pull-requests permissions.
14+
contents: write
15+
pull-requests: write
1216
steps:
1317
- name: Checkout repository
1418
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

0 commit comments

Comments
 (0)