Last active
May 15, 2023 20:26
-
-
Save kylos101/3b36d667280614973a480ec114d7ec4f to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# generate a friendly changelog | |
# gh auth login | |
# view gh auth status | |
# gh auth status | |
# given a json object with two arrays of PR links | |
TEAM=$(jq -r '.deployedPRs.team[]' < released.json) | |
ALL=$(jq -r '.deployedPRs.all[]' < released.json) | |
declare -A PR_LIST | |
for pr in ${TEAM}; do | |
PR_LIST["$pr"]="" | |
done | |
for pr in ${ALL}; do | |
PR_LIST["$pr"]="" | |
done | |
for pr in "${!PR_LIST[@]}"; do | |
PR_NUM=$(echo "$pr" | grep -Eo '[0-9]+$') | |
# echo $PR_NUM | |
REPO_ORG=$(grep -o '[^/]+/[^/]+$' <<< "$pr") | |
# echo $REPO_ORG | |
TITLE=$(gh pr view "$PR_NUM" --repo "$REPO_ORG" --json title | jq -r '.title') | |
# echo $TITLE | |
PR_LIST["$pr"]="$TITLE" | |
done | |
for pr in "${!PR_LIST[@]}"; do | |
echo "${PR_LIST[$pr]}" - "$pr" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment