Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Please ADD ALL Changes to the UNRELEASED SECTION and not a specific release
- Replace raw echo with standard output helpers (die/info/success) in github/cancel-workflows
- Replace raw echo with standard output helpers (die/info/success) in git/update-repos-personal
- GEOIP - Updated GEOIP DB from MaxMind (2026-06-06)
- Replace raw echo with output helpers (die, info, success) in git/missing-release-branches
### Deprecated
### Removed
### Deployment Changes
Expand Down
39 changes: 28 additions & 11 deletions git/missing-release-branches
Original file line number Diff line number Diff line change
@@ -1,32 +1,49 @@
#! /bin/bash

die() {
printf '\n\033[31m✗\033[0m %s\n' "$*" >&2
exit 1
}

success() {
printf '\n\033[32m✓\033[0m %s\n' "$*"
}

info() {
printf '\n\033[32m→\033[0m %s\n' "$*"
}

REGEX_CHANGELOG="^([0-9a-zA-Z]*)\s.*Changelog\sfor\s([0-9]*\.[0-9]*\.[0-9]*)$"

matchingBranch() {
CHANGE_RELEASE=$1
SEARCH_BRANCH="origin/release/$CHANGE_RELEASE"
git branch --remote | while read -r BRANCH; do
#echo "SRC: $BRANCH"
if [[ "$BRANCH" = "$SEARCH_BRANCH" ]]; then
echo "Y"
break
fi
done
}
git log --oneline | while read -r CHANGE; do

if git log --oneline | while read -r CHANGE; do
if [[ $CHANGE =~ $REGEX_CHANGELOG ]]; then
CHANGE_HASH="${BASH_REMATCH[1]}"
CHANGE_RELEASE="${BASH_REMATCH[2]}"

FOUND=$(matchingBranch "$CHANGE_RELEASE")
FOUND=$(matchingBranch "$CHANGE_RELEASE")
if [ "$FOUND" = "Y" ]; then
echo "* Found Release $CHANGE_RELEASE at in release/$CHANGE_RELEASE at $CHANGE_HASH"
else
echo "- Missing Release $CHANGE_RELEASE in $CHANGE_HASH"
info "Found Release $CHANGE_RELEASE in release/$CHANGE_RELEASE at $CHANGE_HASH"
else
info "Missing Release $CHANGE_RELEASE in $CHANGE_HASH"
git checkout "$CHANGE_HASH" && git checkout -b "release/$CHANGE_RELEASE" && git push
git switch main || echo "Switching to Main"
echo "+++ Created branch release/$CHANGE_RELEASE"
git switch main || true
success "Created branch release/$CHANGE_RELEASE"
fi

fi
done && echo "OK" || echo "Failed"
done; then
success "OK"
else
die "Failed"
fi
Loading