diff --git a/.github/workflows/add-label.yml b/.github/workflows/add-label.yml new file mode 100644 index 00000000000000..fc9c1a948b7a71 --- /dev/null +++ b/.github/workflows/add-label.yml @@ -0,0 +1,66 @@ +# 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: Add Meta-change Label + +on: + pull_request: + push: + branches: + - master + +jobs: + add-meta-change-label: + runs-on: ubuntu-latest + + steps: + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" + if: ${{ github.event_name != 'pull_request' }} + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: "Checkout ${{ github.ref }} ( ${{ github.event.pull_request.head.sha }} )" + if: ${{ github.event_name == 'pull_request' }} + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + submodules: recursive + + - name: Paths filter + uses: ./.github/actions/paths-filter + id: filter + with: + filters: | + meta_changes: + - 'fe/fe-common/src/main/java/org/apache/doris/common/FeMetaVersion.java' + - 'fe/fe-core/src/main/java/org/apache/doris/alter/AlterOpType.java' + - 'gensrc/thrift/*' + - 'gensrc/proto/*' + + - name: "Add meta-change label to PR" + if: ${{ steps.filter.outputs.meta_changes == 'true' }} + uses: actions/github-script@v6 + with: + script: | + github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['meta-change'] + });