From 572d4638263ee9042e14ec819e0ed11088174689 Mon Sep 17 00:00:00 2001 From: Denis Varlakov Date: Thu, 17 Oct 2024 15:09:47 +0200 Subject: [PATCH] Update changelog script Signed-off-by: Denis Varlakov --- .github/changelog.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/changelog.sh b/.github/changelog.sh index c13efe4..fa3c35a 100755 --- a/.github/changelog.sh +++ b/.github/changelog.sh @@ -1,19 +1,22 @@ #!/usr/bin/env bash m_branch=m; +changelog_file=CHANGELOG.md; # fetch master since we might be in a shallow clone git fetch origin "$m_branch:$m_branch" --depth=1 changed=0; -dir=.; -# check if version changed -if git diff "$m_branch" -- "Cargo.toml" | grep -q "^-version = "; then - # check if changelog updated - if git diff --exit-code --no-patch "$m_branch" -- "CHANGELOG.md"; then - echo "$dir version changed, but CHANGELOG.md is not updated" - changed=1; +for log in "$changelog_file" */"$changelog_file"; do + dir=$(dirname "$log"); + # check if version changed + if git diff "$m_branch" -- "$dir/Cargo.toml" | grep -q "^-version = "; then + # check if changelog updated + if git diff --exit-code --no-patch "$m_branch" -- "$log"; then + echo "$dir version changed, but $log is not updated" + changed=1; + fi fi -fi +done exit "$changed";