mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
cf7d37ad13
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
35 lines
1.4 KiB
YAML
35 lines
1.4 KiB
YAML
name: "news.txt check"
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, ready_for_review]
|
|
branches:
|
|
- 'master'
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
if: github.event.pull_request.draft == false
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
- name: news.txt needs to be updated
|
|
run: |
|
|
for commit in $(git rev-list HEAD~${{ github.event.pull_request.commits }}..HEAD); do
|
|
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
|
|
! git diff HEAD~${{ github.event.pull_request.commits }}..HEAD --quiet runtime/doc/news.txt ||
|
|
{
|
|
echo "
|
|
Pull request includes a new feature or a breaking change, but
|
|
news.txt hasn't been updated yet. This is just a reminder
|
|
that news.txt may need to be updated. You can ignore this CI
|
|
failure if you think the change won't be of interest to
|
|
users."
|
|
exit 1
|
|
}
|
|
fi
|
|
done
|