Created
December 14, 2021 21:40
-
-
Save bencooper222/7c233eb0881b31e86cbe45bf07c08cd2 to your computer and use it in GitHub Desktop.
Opens the circleci (assuming github) workflow for the repo/branch your working directory is in
This file contains 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
inside_git_repo="$(git rev-parse --is-inside-work-tree 2>/dev/null)" | |
if [ ! "$inside_git_repo" ]; then | |
echo "not in git repo" | |
exit | |
fi | |
BRANCH="$(git rev-parse --abbrev-ref HEAD | tr -d '\n' | xargs | jq -sRr @uri | sed -e "s/%0A$//")" | |
# if your origin isn't ssh, this probably won't work | |
REMOTE="$(git config --get remote.origin.url | xargs | cut -d ":" -f2 | sed -e "s/.git$//")" | |
# echo $BRANCH | |
# echo $REMOTE | |
URL="https://app.circleci.com/pipelines/github/$REMOTE?branch=$BRANCH&filter=all" | |
# echo $URL | |
open $URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment