SIGN IN SIGN UP

Script to ghstack land (#6270)

Summary:
Per ghstack [tutorial](https://github.com/ezyang/ghstack/blob/master/README.md#structure-of-submitted-pull-requests) for a PR exported by ghstack, it will have two diff sets:
- `gh/user/1/base <- gh/user/1/head` where the PR is created like [this](https://github.com/pytorch/executorch/pull/6265)
- `main <- gh/user/1/orig`

The purpose of this bot is, when the ghstack PR is merged, automatically create another PR to do this merge `main <- gh/user/1/orig`. Then we just merge the newly created PR so that `main` has that change.

Missing piece: token from pytorch bot to create PR.

If this goes well, we can either `git merge` the commit from gh/user/1/orig into main directly, without going through the new PR; or auto approve and merge the PR.

Pull Request resolved: https://github.com/pytorch/executorch/pull/6270

Test Plan:
You can test locally with `export GITHUB_TOKEN=ghpxyz; python .github/scripts/propose_ghstack_orig_pr.py --pr 6265 --repo pytorch/executorch`
Note that between /orig merges, there is never a merge conflict.

The invariant is guaranteed that gh/user/1/orig contains the exact same change between `gh/user/1/base <- gh/user/1/head` by ghstack tool.

Reviewed By: huydhn

Differential Revision: D64569002

Pulled By: kirklandsign

fbshipit-source-id: 9af16e3d292a1c835b98b345efaca8946593c9ed
H
Hansong Zhang committed
18a7e659de16b93c41bb689056bfc354a2fa14cf
Parent: a835e03
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 10/17/2024, 11:23:46 PM