Skip to content

Commit

Permalink
Update changelog script
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Varlakov <[email protected]>
  • Loading branch information
survived committed Oct 17, 2024
1 parent feaf275 commit 47cd8bf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +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;
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
done

exit "$changed";

0 comments on commit 47cd8bf

Please sign in to comment.