summaryrefslogtreecommitdiffstats
path: root/ansible_collections/community/grafana/hacking/check_fragment.sh
blob: 3173b342fbd9ad027bf6fcc528ceb15b4c85d2dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash

function fail() {
	cat <<EOF
    Dear contributor,

    Thank you for you Pull Request !
    To ease the work of maintainers you need to add a [changelog fragment](https://docs.ansible.com/ansible/latest/community/development_process.html#creating-a-changelog-fragment) in you PR.

    It will help your change be released faster !
    Thank you !
EOF
	exit 1
}

FRAGMENTS=$(git fetch && git diff --name-only --diff-filter=ACMRT origin/main..HEAD | grep "changelogs")
[ -z "$FRAGMENTS" ] && fail
exit 0