news.yml (1568B)
1 name: "news.txt" 2 on: 3 pull_request: 4 types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] 5 branches: 6 - 'master' 7 jobs: 8 check: 9 runs-on: ubuntu-latest 10 if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci:skip-news') 11 steps: 12 - uses: actions/checkout@v6 13 with: 14 fetch-depth: 0 15 ref: ${{ github.event.pull_request.head.sha }} 16 - name: news.txt needs to be updated 17 run: | 18 for commit in $(git rev-list HEAD~${{ github.event.pull_request.commits }}..HEAD); do 19 message=$(git log -n1 --pretty=format:%s $commit) 20 type="$(echo "$message" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')" 21 breaking="$(echo "$message" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" 22 if [[ "$type" == "feat" ]] || [[ "$type" == "perf" ]] || [[ "$breaking" == "breaking-change" ]]; then 23 ! git diff HEAD~${{ github.event.pull_request.commits }}..HEAD --quiet runtime/doc/news.txt runtime/doc/deprecated.txt || 24 { 25 echo " 26 Pull request includes a new feature, performance improvement 27 or a breaking change, but news.txt hasn't been updated yet. 28 This is just a reminder that news.txt may need to be updated. 29 You can ignore this CI failure if you think the change won't 30 be of interest to users." 31 exit 1 32 } 33 fi 34 done