Skip to content

Commit 20be40d

Browse files
committed
.github: make the rebase step re-usable
1 parent 8b31a37 commit 20be40d

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

.github/actions/rebase/action.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "Rebase on to the PR target base branch"
2+
description: "A reusable workflow that's used to rebase the PR code on to the target base branch."
3+
4+
runs:
5+
using: "composite"
6+
7+
steps:
8+
- name: fetch and rebase on ${{ github.base_ref }}
9+
shell: bash
10+
run: |
11+
git remote add upstream https://github.com/${{ github.repository }}
12+
git fetch upstream ${{ github.base_ref }}:refs/remotes/upstream/${{ github.base_ref }}
13+
export GIT_COMMITTER_EMAIL="[email protected]"
14+
export GIT_COMMITTER_NAME="LND CI"
15+
git rebase upstream/${{ github.base_ref }}

.github/workflows/main.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,7 @@ jobs:
103103
go-version: '${{ env.GO_VERSION }}'
104104

105105
- name: fetch and rebase on ${{ github.base_ref }}
106-
run: |
107-
git remote add upstream https://github.com/${{ github.repository }}
108-
git fetch upstream ${{ github.base_ref }}:refs/remotes/upstream/${{ github.base_ref }}
109-
export GIT_COMMITTER_EMAIL="[email protected]"
110-
export GIT_COMMITTER_NAME="LND CI"
111-
git rebase upstream/${{ github.base_ref }}
106+
uses: ./.github/actions/rebase
112107

113108
- name: check commits
114109
run: scripts/check-each-commit.sh upstream/${{ github.base_ref }}

0 commit comments

Comments
 (0)