Skip to content

[ci] grants write permission to create branch in remote#11269

Merged
auto-submit[bot] merged 2 commits into
flutter:mainfrom
chunhtai:add-write
Mar 19, 2026
Merged

[ci] grants write permission to create branch in remote#11269
auto-submit[bot] merged 2 commits into
flutter:mainfrom
chunhtai:add-write

Conversation

@chunhtai

Copy link
Copy Markdown
Contributor

The branch release workflow failed with

Parsing package "packages/packages/go_router"...
  Creating new branch "go_router-23134404669-1"...
  Pushing branch go_router-23134404669-1 to remote origin...
Unhandled exception:
ProcessException: 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
  Command: git push origin go_router-23134404669-1

https://github.com/flutter/packages/actions/runs/23134404669/job/67194648551

Pre-Review Checklist

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. 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.

Footnotes

  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. 2

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@chunhtai chunhtai requested a review from stuartmorgan-g March 16, 2026 20:32
@chunhtai chunhtai added the CICD Run CI/CD label Mar 16, 2026
@stuartmorgan-g

stuartmorgan-g commented Mar 17, 2026

Copy link
Copy Markdown
Collaborator

Giving the entire job full write permissions to the repo seems very risky. Can we refactor to have a specific step do nothing but create the branch, and give only that step write access?

/cc @jtmcdole for potential Infra input on access scoping.

@chunhtai chunhtai added CICD Run CI/CD and removed CICD Run CI/CD labels Mar 17, 2026
@chunhtai

Copy link
Copy Markdown
Contributor Author

There isn't a good way to set granular permission for each step unless we use Personal access token. The best we can do is to separate out different job and gave different permission for each job. However, each job will be different run instance, and won't share the environment setup. This means the source code checkout and repo tool setup will have to be called for each job.

I separated out the branch creation and pull request creation to be separated job to have slightly better permission control.

If we want anything better, we will need to set up PAT, probably using the @fluttergithubbot .

@chunhtai

Copy link
Copy Markdown
Contributor Author

a friendly ping, this is blocking go_router releases

@stuartmorgan-g stuartmorgan-g left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I just realized that release.yaml already uses this permission, since it's pushing tags, so the large permission scope is a pre-existing issue. Probably something we should revisit with smaller scope in a future design, but for now this is consistent with our current auto-releases.

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 19, 2026
@auto-submit auto-submit Bot merged commit 8dcfd11 into flutter:main Mar 19, 2026
81 checks passed
github-merge-queue Bot pushed a commit to flutter/flutter that referenced this pull request Mar 20, 2026
flutter/packages@99155a8...8dcfd11

2026-03-19 47866232+chunhtai@users.noreply.github.com [ci] grants write
permission to create branch in remote (flutter/packages#11269)
2026-03-19 Deil.Christoph@gmail.com [camera] Make Optional.of
constructor const (flutter/packages#11247)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@Piinks

Piinks commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

It looks like the tree has been broken since this change, should we revert?

@chunhtai

Copy link
Copy Markdown
Contributor Author

The current breakage is due FTL flutter/flutter#183935

@Piinks

Piinks commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Ah gotcha! Thank you. This is why I asked first. 😅

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

FTL and now flutter/flutter#184047 as well.

okorohelijah pushed a commit to okorohelijah/packages that referenced this pull request Mar 26, 2026
The branch release workflow failed with

```
Parsing package "packages/packages/go_router"...
  Creating new branch "go_router-23134404669-1"...
  Pushing branch go_router-23134404669-1 to remote origin...
Unhandled exception:
ProcessException: 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
  Command: git push origin go_router-23134404669-1
```

https://github.com/flutter/packages/actions/runs/23134404669/job/67194648551

## Pre-Review Checklist

**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.
mboetger pushed a commit to mboetger/flutter that referenced this pull request Mar 26, 2026
…r#183930)

flutter/packages@99155a8...8dcfd11

2026-03-19 47866232+chunhtai@users.noreply.github.com [ci] grants write
permission to create branch in remote (flutter/packages#11269)
2026-03-19 Deil.Christoph@gmail.com [camera] Make Optional.of
constructor const (flutter/packages#11247)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
ahmedsameha1 pushed a commit to ahmedsameha1/flutter that referenced this pull request Apr 14, 2026
…r#183930)

flutter/packages@99155a8...8dcfd11

2026-03-19 47866232+chunhtai@users.noreply.github.com [ci] grants write
permission to create branch in remote (flutter/packages#11269)
2026-03-19 Deil.Christoph@gmail.com [camera] Make Optional.of
constructor const (flutter/packages#11247)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
The branch release workflow failed with

```
Parsing package "packages/packages/go_router"...
  Creating new branch "go_router-23134404669-1"...
  Pushing branch go_router-23134404669-1 to remote origin...
Unhandled exception:
ProcessException: 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
  Command: git push origin go_router-23134404669-1
```

https://github.com/flutter/packages/actions/runs/23134404669/job/67194648551

## Pre-Review Checklist

**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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants