mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 02:53:51 +08:00
Add workflow to check for CHANGELOG update
This commit is contained in:
parent
1676259840
commit
effc8efe14
49
.github/workflows/changelog-check.yaml
vendored
Normal file
49
.github/workflows/changelog-check.yaml
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
name: Check CHANGELOG.md updated
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, edited]
|
||||
branches: [main]
|
||||
jobs:
|
||||
# Check that the CHANGELOG is updated by the pull request. This can be
|
||||
# disabled by adding a trailer line of the following form to the
|
||||
# pull request message:
|
||||
#
|
||||
# Disable-Check: force-changelog-changed
|
||||
#
|
||||
# The check is case-insensitive and ignores other contents on the
|
||||
# line as well, so it is possible to add several different checks if
|
||||
# that is necessary.
|
||||
#
|
||||
# It is assumed that the trailer is following RFC2822 conventions,
|
||||
# but this is currently not enforced.
|
||||
check_changelog_update:
|
||||
name: Check for CHANGELOG.md changes
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout source
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
- name: Check CHANGELOG.md updated by pull request
|
||||
shell: bash --norc --noprofile {0}
|
||||
run: |
|
||||
diff=$(git diff --name-status origin/main | grep "CHANGELOG.md")
|
||||
cat << "EOF" | egrep -qsi '^disable-check:.*\<force-changelog-changed\>'
|
||||
${{ github.event.pull_request.body }}
|
||||
EOF
|
||||
if [[ $? -ne 0 ]]; then
|
||||
if [[ $diff == '' ]]; then
|
||||
echo
|
||||
echo "CHANGELOG.md not updated by pull request"
|
||||
echo
|
||||
echo "To disable changelog updated check, add this trailer to pull request message:"
|
||||
echo
|
||||
echo "Disable-check: force-changelog-changed"
|
||||
echo
|
||||
echo "Trailers follow RFC2822 conventions, so no whitespace"
|
||||
echo "before field name and the check is case-insensitive for"
|
||||
echo "both the field name and the field body."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
2
build-13/.gitattributes
vendored
Normal file
2
build-13/.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
# to avoid frequent conflicts
|
||||
CHANGELOG.md text merge=union
|
Loading…
x
Reference in New Issue
Block a user