-
Notifications
You must be signed in to change notification settings - Fork 140
Support rebasing PR from forks and allow only selected users to rebase #17
Conversation
For now use this branch: https://github.com/drdanz/rebase/tree/pr_from_fork until cirrus-actions/rebase#17 is accepted upstream.
This works only if the "Allow edit from maintainers" option is checked and the `GITHUB_TOKEN` variable is set using a developer token, i.e. env: GITHUB_TOKEN: ${{ secrets.GITHUB_OAUTH_TOKEN }}
Instead of using a generic name and address, fetch these information from using the GitHub API.
If an environment variable `<user_login>_TOKEN` exists, that variable is used instead of `GITHUB_TOKEN`. This makes it possible to allow only some users to rebase the PRs by setting env: <user1>_TOKEN: ${{ secrets.<user1>_TOKEN }} <user2>_TOKEN: ${{ secrets.<user2>_TOKEN }}
0dee9e7
to
81000d9
Compare
rebased over latest master |
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.
Sorry for a delayed review! The notification about the PR got lost.
|
||
git remote set-url origin https://x-access-token:$COMMITTER_TOKEN@github.com/$GITHUB_REPOSITORY.git | ||
git config --global user.email "$USER_EMAIL" | ||
git config --global user.name "$USER_NAME" |
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 you should do the user customization here only if USER_TOKEN
is defined. Otherwise you should fall back to the original logic. What do you think?
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.
To be honest I'd like to be able to know who started the rebase...
/rebase |
1 similar comment
/rebase |
/rebase |
@fkorotkov any blockers to merging this? This seems to solve a very important use case :) |
@mikeparker I just don't like that "solution" but unfortunately it seems there is no other way to support it at the moment. |
Support rebasing PR from forks
This works only if the "Allow edit from maintainers" option is checked
and the
GITHUB_TOKEN
variable is set using a developer token, i.e.Fixes #12
Use the user name and email for committer name
Instead of using a generic name and address, fetch these information
from using the GitHub API.
Allow user based tokens
If an environment variable
<user_login>_TOKEN
exists, that variable isused instead of
GITHUB_TOKEN
.This makes it possible to allow only some users to rebase the PRs by
setting