workflow: When updating the issueXX branch, use force push
authorTobias Hieta <tobias@hieta.se>
Fri, 8 Apr 2022 07:28:22 +0000 (09:28 +0200)
committerTobias Hieta <tobias@hieta.se>
Tue, 12 Apr 2022 06:03:59 +0000 (08:03 +0200)
Otherwise if you try to update the branch with a new /cherry-pick
from the same issue you will run into problems similar as to the
one shown in this workflow:
https://github.com/llvm/llvm-project/runs/5864672298?check_suite_focus=true

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D123365

llvm/utils/git/github-automation.py

index aa4284c..3164371 100755 (executable)
@@ -185,7 +185,7 @@ class ReleaseWorkflow:
 
         push_url = self.push_url
         print('Pushing to {} {}'.format(push_url, branch_name))
-        local_repo.git.push(push_url, 'HEAD:{}'.format(branch_name))
+        local_repo.git.push(push_url, 'HEAD:{}'.format(branch_name), force=True)
 
         self.issue_notify_branch()
         self.issue_remove_cherry_pick_failed_label()