Skip to content

Commit

Permalink
ci(github-actions): add script to check the news fragment content
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-W committed Nov 27, 2024
1 parent 37e0789 commit d010561
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/news-fragment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit d010561

Please sign in to comment.