Created
March 7, 2022 11:48
-
-
Save mowtschan/245f20a588d5dfa1f83b60449e7e5e74 to your computer and use it in GitHub Desktop.
Open browser for Pull Request in azure devops
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
TARGET_BRANCH=main | |
REMOTE=$(git remote get-url origin) | |
# assume the repo uses SSH | |
REMOTE=${REMOTE#"[email protected]:v3/"} | |
arr=(${REMOTE//// }) | |
REMOTE="${arr[0]}/${arr[1]}/_git/${arr[2]}" | |
URL="https://dev.azure.com/$REMOTE/pullrequestcreate?sourceRef=$BRANCH&targetRef=$TARGET_BRANCH" | |
open "$URL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment