Skip to content

Commit 2a61dc8

Browse files
author
玖宇
committed
Workflow: add rebase code after checkout
Signed-off-by: 玖宇 <guotongyu.gty@alibaba-inc.com>
1 parent 9ebcdef commit 2a61dc8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/project-check.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ jobs:
3838
with:
3939
path: ${{ env.GOPATH }}/src/github.com/fluid-cloudnative/fluid
4040

41+
- name: Check rebase
42+
run: |
43+
git fetch origin master
44+
# Check if the current branch contains the latest master commit
45+
MASTER_COMMIT=$(git rev-parse origin/master)
46+
if ! git merge-base --is-ancestor $MASTER_COMMIT HEAD; then
47+
echo "::error ::Current branch is not up-to-date with master. Please rebase."
48+
exit 1
49+
fi
50+
4151
- name: Lint golang code
4252
uses: golangci/golangci-lint-action@v6
4353
with:

0 commit comments

Comments
 (0)