File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Rebase against upstream
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - master
7+ schedule :
8+ - cron : ' 15 3 * * *'
9+
10+ jobs :
11+ rebase :
12+ name : Rebase now!
13+ runs-on : ubuntu-latest
14+ env :
15+ BASE_BRANCH : release-ci
16+ UPSTREAM_REPO : https://github.com/haskell/cabal.git
17+ UPSTREAM_BRANCH : master
18+ steps :
19+ - name : Checkout code
20+ uses : actions/checkout@v4
21+ with :
22+ ref : ${{ env.BASE_BRANCH }}
23+
24+ - run : |
25+ set -eux
26+
27+ base_branch=${{ env.BASE_BRANCH }}
28+ upstream_repo=${{ env.UPSTREAM_REPO }}
29+ upstream_branch=${{ env.UPSTREAM_BRANCH }}
30+
31+ git remote add upstream "${upstream_repo}"
32+ git fetch upstream
33+ common_ancestor=$(git merge-base "${base_branch}" "upstream/${upstream_branch}")
34+ git format-patch "${common_ancestor}".."${base_branch}"
35+ git archive "${base_branch}" > backup.tar
36+ tar -rf backup.tar .git
37+ git am *.patch
38+ git push -f origin master-rebased
39+
40+ - if : always()
41+ name : Upload backup
42+ uses : actions/upload-artifact@v4
43+ with :
44+ if-no-files-found : error
45+ retention-days : 7
46+ name : backup
47+ path : |
48+ ./backup.tar
You can’t perform that action at this time.
0 commit comments