2022-12-05 03:58:30 -07:00
|
|
|
name: "news.txt check"
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
2022-12-06 09:38:24 -07:00
|
|
|
fetch-depth: 0
|
2022-12-05 03:58:30 -07:00
|
|
|
- name: news.txt needs to be updated
|
|
|
|
run: |
|
2022-12-06 09:38:24 -07:00
|
|
|
for commit in $(git rev-list HEAD~${{ github.event.pull_request.commits }}..HEAD); do
|
2022-12-05 03:58:30 -07:00
|
|
|
message=$(git log -n1 --pretty=format:%s $commit)
|
|
|
|
type="$(echo "$message" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')"
|
|
|
|
breaking="$(echo "$message" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')"
|
|
|
|
if [[ "$type" == "feat" ]] || [[ "$breaking" == "breaking-change" ]]; then
|
2022-12-06 09:38:24 -07:00
|
|
|
! git diff HEAD~${{ github.event.pull_request.commits }}..HEAD --quiet runtime/doc/news.txt ||
|
2022-12-05 03:58:30 -07:00
|
|
|
{
|
|
|
|
echo "
|
|
|
|
Pull request includes a new feature or a breaking change, but
|
|
|
|
news.txt hasn't been updated yet. news.txt is our primary way of
|
|
|
|
communicating changes to users so it's important to keep it up to
|
|
|
|
date."
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
fi
|
|
|
|
done
|