refactor(scripts): changelog

Fix shellcheck issues
main
sundowndev 2022-01-24 15:26:27 +04:00
parent b751cd50ae
commit 99ed042a1e
No known key found for this signature in database
GPG Key ID: 100CE2799D978462
1 changed files with 5 additions and 5 deletions

View File

@ -24,23 +24,23 @@ fi
# Compare $BASE branch with the latest tag
# Keep IDs of merged pull requests
PRs=$(git log --pretty=oneline $BASE...$LATEST_TAG | grep 'Merge pull request #' | grep -oP '#[0-9]+' | sed 's/#//')
PRs=$(git log --pretty=oneline "$BASE"..."$LATEST_TAG" | grep 'Merge pull request #' | grep -oP '#[0-9]+' | sed 's/#//')
# Generating changelog for commits from $BASE to $LATEST_TAG
CHANGES=()
for pr in $PRs; do
str=$($GHCLI_BIN pr view $pr --repo $REPO -t '- {{ .title }} (#{{ .number }}) @{{ .author.login }} {{.labels}}' --json title,number,author,labels)
str=$($GHCLI_BIN pr view "$pr" --repo $REPO -t '- {{ .title }} (#{{ .number }}) @{{ .author.login }} {{.labels}}' --json title,number,author,labels)
CHANGES+=("$str")
done
print_changes() {
local label=$1
local title=$2
if [[ "${CHANGES[@]}" =~ $label ]]; then
echo -e $title
if [[ "${CHANGES[*]}" =~ $label ]]; then
echo -e "$title"
for change in "${CHANGES[@]}"; do
if [[ $change =~ $label ]]; then
echo $change | sed "s/\[map\[$PARTITION_COLUMN.*//"
echo "$change" | sed "s/\[map\[$PARTITION_COLUMN.*//"
fi
done
fi