Skip to content

Instantly share code, notes, and snippets.

@flavianmissi
Last active March 11, 2021 21:10
Show Gist options
  • Save flavianmissi/aff629739006e66a2c3f4e4b96981e57 to your computer and use it in GitHub Desktop.
Save flavianmissi/aff629739006e66a2c3f4e4b96981e57 to your computer and use it in GitHub Desktop.
add reviewer to PR
# usage:
# add_reviewer_to_PR <your-username> <reviewer> <one-time-password> <PR-nr>
# you'll be prompted for your github password.
function add_reviewer_to_PR {
user=$1
reviewer=$2
OTP=$3
PR=$4
curl -X POST -u "$user" -H 'Content-Type: application/json' -H "X-GitHub-OTP: $OTP" -d "{\"reviewers\": [\"$reviewer\"]}" https://api.github.com/repos/mindoktor/mindoktor/pulls/"$PR"/requested_reviewers
}
@hwsoderlund
Copy link

Maybe add comments and an example on how to call the function

@flavianmissi
Copy link
Author

Maybe add comments and an example on how to call the function

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment