From d010561d77a169e9e75e9960ea2879309a7ac4c9 Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Wed, 27 Nov 2024 10:13:10 +0800 Subject: [PATCH] ci(github-actions): add script to check the news fragment content --- .github/workflows/news-fragment.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/news-fragment.yml b/.github/workflows/news-fragment.yml index bf1bd6ce27b2b..4bcf95e2bba88 100644 --- a/.github/workflows/news-fragment.yml +++ b/.github/workflows/news-fragment.yml @@ -36,7 +36,7 @@ jobs: # needs a non-shallow clone. fetch-depth: 0 - - name: Check news fragment + - name: Check news fragment existence run: > python -m pip install --upgrade uv && uv tool run towncrier check @@ -52,3 +52,26 @@ jobs: && false ; } + + - name: Check news fragment contains change types + run: > + change_types=( + 'DAG changes' + 'Config changes' + 'API changes' + 'CLI changes' + 'Behaviour changes' + 'Plugin changes' + 'Dependency change' + ) + news_fragment_content=`git diff origin/${{ github.base_ref }} newsfragments/*.significant.rst` + + for type in "${change_types[@]}"; do + if [[ $news_fragment_content != *"$type"* ]]; then + printf "\033[1;33mMissing change type '$type' in significant newsfragment for PR labeled with + 'airflow3.0:breaking'.\nCheck + https://github.com/apache/airflow/blob/main/contributing-docs/16_contribution_workflow.rst + for guidance.\033[m\n" + exit 1 + fi + done