Skip to content

Commit

Permalink
Merge pull request #11 from LFDT-Lockness/update-changelog-script
Browse files Browse the repository at this point in the history
Update changelog script
  • Loading branch information
survived authored Oct 17, 2024
2 parents feaf275 + 8780b00 commit 8dc4781
Show file tree
Hide file tree
Showing 2 changed files with 28 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";
6 changes: 6 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,9 @@ jobs:
cache-on-failure: "true"
- name: Check docs
run: RUSTDOCFLAGS="--cfg docsrs -D warnings" cargo +nightly doc --workspace --all-features --no-deps
check-changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check changelogs
run: ./.github/changelog.sh

0 comments on commit 8dc4781

Please sign in to comment.