Skip to content

Commit

Permalink
actions: syncer: Abort failed rebases
Browse files Browse the repository at this point in the history
When the rebase fails the repo ends up in a mangled state. For example,
.github/sync-failed-template.md might not even be present in the source
directory after the failed rebase, which causes the "create-an-issue"
action to fail.

Fix this by aborting the rebase on failure so that the source directory
gets back to a sane state.

Fixes: https://github.com/mgalgs/gnome-shell-system-monitor-applet/runs/4106665884

    Error: File .github/sync-failed-template.md could not be found in your
    project's workspace. You may need the actions/checkout action to clone
    the repository first.
  • Loading branch information
mgalgs committed Nov 9, 2021
1 parent 98d3c59 commit 30eed8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions actions/syncer/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ git remote -v
git fetch upstream
git rebase upstream/master || {
echo "Couldn't rebase against upstream :(. Please rebase manually."
# Right now the repo is in a mangled state, awaiting merge conflict
# resolution. Abort the rebase to ensure that all of our fork patches
# are present for subsequent actions.
git rebase --abort
exit 1
}
echo "After rebase: next=$(git rev-parse master) upstream=$(git rev-parse upstream/master)"
Expand Down

0 comments on commit 30eed8e

Please sign in to comment.