diff options
author | EuAndreh <eu@euandre.org> | 2021-06-15 08:21:39 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-06-15 08:23:27 -0300 |
commit | 2c46bb5bef55715db5b922900a01863d40c370dd (patch) | |
tree | 8d1ac57c7e8e85464cea60a08748dcf9eb8e6051 /aux/workflow/assert-changelog.sh | |
parent | TODOs.md: Add #task-3cf42559-3713-02c6-bba3-af5bac5512a7 (diff) | |
download | euandre.org-2c46bb5bef55715db5b922900a01863d40c370dd.tar.gz euandre.org-2c46bb5bef55715db5b922900a01863d40c370dd.tar.xz |
aux/: Update
Diffstat (limited to '')
-rwxr-xr-x | aux/workflow/assert-changelog.sh | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/aux/workflow/assert-changelog.sh b/aux/workflow/assert-changelog.sh index 8e81f1f..bef610b 100755 --- a/aux/workflow/assert-changelog.sh +++ b/aux/workflow/assert-changelog.sh @@ -2,13 +2,28 @@ set -eu PROJECT="$1" +shift -for VVERSION in $(git tag); do - VERSION="${VVERSION#v}" - DATE="$(git log -1 --format=%cd --date=short "$VVERSION")" +assert() { + DATE="$1" + VVERSION="$2" + VERSION="${2#v}" CHANGELOG_ENTRY="# [$VERSION](https://git.euandreh.xyz/$PROJECT/commit/?id=$VVERSION) - $DATE" + if ! grep -qF "$CHANGELOG_ENTRY" CHANGELOG.md; then echo "Missing '$CHANGELOG_ENTRY' entry from CHANGELOG.md" >&2 exit 1 fi +} + +for VVERSION in $(git tag); do + DATE="$(git log -1 --format=%cd --date=short "$VVERSION")" + assert "$DATE" "$VVERSION" +done + +# "$@" represents a list of tags to be also included in the verification. +# shellcheck disable=2068 +for VVERSION in $@; do + DATE="$(date '+%Y-%m-%d')" + assert "$DATE" "$VVERSION" done |