potiuk commented on code in PR #41443: URL: https://github.com/apache/airflow/pull/41443#discussion_r1716074427
########## .github/workflows/news-fragment.yml: ########## @@ -0,0 +1,52 @@ +# 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: CI + +on: # yamllint disable-line rule:truthy + pull_request: + types: [labeled, unlabeled, opened, reopened, synchronize] + +jobs: + check-news-fragment: + name: Check News Fragment + runs-on: ubuntu-20.04 + if: "contains(github.event.pull_request.labels.*.name, 'airflow3.0:breaking')" + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + # `towncrier check` runs `git diff --name-only origin/main...`, which + # needs a non-shallow clone. + fetch-depth: 0 Review Comment: this is how selective check finds files that changed since last check: ``` - name: Fetch incoming commit ${{ github.sha }} with its parent uses: actions/checkout@v4 with: ref: ${{ github.sha }} fetch-depth: 2 persist-credentials: false - name: "Install Breeze" uses: ./.github/actions/breeze - name: "Get information about the Workflow" id: source-run-info run: breeze ci get-workflow-info 2>> ${GITHUB_OUTPUT} - name: Selective checks id: selective-checks env: PR_LABELS: "${{ steps.source-run-info.outputs.pr-labels }}" COMMIT_REF: "${{ github.sha }}" VERBOSE: "false" run: breeze ci selective-check 2>> ${GITHUB_OUTPUT} ``` ```python def get_changed_files(commit_ref: str | None) -> tuple[str, ...]: if commit_ref is None: return () cmd = [ "git", "diff-tree", "--no-commit-id", "--name-only", "-r", commit_ref + "^", commit_ref, ] ```` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
