Skip to content

Commit

Permalink
[Feature](GA)Latest-Master-Code-Check (apache#20786)
Browse files Browse the repository at this point in the history
  • Loading branch information
CalvinKirs authored Jun 15, 2023
1 parent 9716b87 commit 0dc1b50
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/auto_trigger_teamcity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_COMMENT: ${{ github.event.comment.body }}

needs: Latest-Master-Code-Check
steps:
- name: Run pipeline by teamcity restful
run: |
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/latest-code-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
---
name: Latest-Master-Code-Check
on:
pull_request:
push:
branches:
- master

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Add remote and fetch main branch
run: |
git remote add upstream https://github.com/apache/doris.git
git fetch upstream master
- name: Check if code includes latest code of master branch
run: |
if git merge-base --is-ancestor upstream/master HEAD; then
echo "Your branch is up-to-date with master"
else
echo "Your branch is behind master, please rebase your branch with master"
exit 1
fi

0 comments on commit 0dc1b50

Please sign in to comment.