Skip to content
Open
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
26 changes: 26 additions & 0 deletions hack/rebasebot-helpers/post-rebase.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# This script is run by rebasebot as a post-rebase hook during the rebase of
# openshift/cluster-api-provider-openstack.
# It replaces the merge-bot's --run-make flag which ran `make merge-bot`.

set -e
set -o pipefail

if [[ -n "$(git status --porcelain)" ]]; then
echo "post-rebase hook requires a clean worktree" >&2
exit 1
fi

make merge-bot

if [[ -z "$REBASEBOT_GIT_USERNAME" || -z "$REBASEBOT_GIT_EMAIL" ]]; then
author_flag=()
else
author_flag=(--author="$REBASEBOT_GIT_USERNAME <$REBASEBOT_GIT_EMAIL>")
fi

if [[ -n $(git status --porcelain) ]]; then
git add -A
git commit "${author_flag[@]}" -q -m "UPSTREAM: <drop>: Run make merge-bot"
fi