Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/scripts/update-release-changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,27 @@ commit_and_push_changelog() {
if [[ "${previous_version_ref,,}" == "null" ]]; then
commit_msg="${commit_msg} (hotfix - no test plan)"
fi
if ! git commit -am "${commit_msg}"; then

local changes_committed=false
if git commit -am "${commit_msg}"; then
changes_committed=true
else
echo "No changes detected; skipping commit."
fi

# Check if there are any differences between the changelog branch and release branch
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The comment could be more descriptive about the purpose of this check. Consider updating it to:

# If no changes were committed, check if the branches are already in sync
# This handles the post-merge scenario where the changelog PR was already merged

This makes it clearer why we're performing this check only when changes_committed is false.

Suggested change
# Check if there are any differences between the changelog branch and release branch
# If no changes were committed, check if the branches are already in sync
# This handles the post-merge scenario where the changelog PR was already merged

Copilot uses AI. Check for mistakes.
if ! ${changes_committed}; then
echo "Checking for differences between ${changelog_branch} and ${release_branch}.."
if ! git diff --quiet "origin/${release_branch}" "HEAD"; then
echo "Differences found between branches; proceeding with PR creation."
else
echo "No differences between ${changelog_branch} and ${release_branch}."
echo "Branches are already in sync; skipping PR creation."
echo "Changelog workflow completed successfully (no updates needed)."
return 0
fi
fi
Comment on lines +177 to +188
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new branch synchronization check logic (lines 177-188) lacks test coverage. Since the repository has test scripts for similar shell scripts (e.g., test-create-platform-release-pr-full.sh and test-create-platform-release-pr-functions.sh), consider adding a test file like .github/scripts/tests/test-update-release-changelog.sh that validates:

  1. The script exits gracefully when branches are in sync (no diff)
  2. The script proceeds with PR creation when differences exist
  3. The changes_committed flag is properly tracked

Copilot uses AI. Check for mistakes.

local pr_body="This PR updates the change log for ${version}."
if [[ "${previous_version_ref,,}" == "null" ]]; then
pr_body="${pr_body} (Hotfix - no test plan generated.)"
Expand Down
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Adds ability to merge Version Bump PRs with PR comment ([#179](https://github.com/MetaMask/github-tools/pull/179))
- Adds ability to merge Version Bump PRs with PR comment ([#179](https://github.com/MetaMask/github-tools/pull/179))

### Changed

- Update to use topology.json instead of old teams.json for commits.csv during create release pr ([#180](https://github.com/MetaMask/github-tools/pull/180))
### Changed

- Update to use topology.json instead of old teams.json for commits.csv during create release pr ([#180](https://github.com/MetaMask/github-tools/pull/180))

## [1.1.0]

Expand Down Expand Up @@ -46,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Some inputs were renamed for consistency across actions.
- Bump `actions/checkout` and `actions/setup-node` to `v6` ([#173](https://github.com/MetaMask/github-tools/pull/173))

[Unreleased]: https://github.com/MetaMask/github-tools/compare/v1.1.0...HEAD
[Unreleased]: https://github.com/MetaMask/github-tools/compare/v1.1.2...HEAD
[1.1.2]: https://github.com/MetaMask/github-tools/compare/v1.1.0...v1.1.2
[1.1.0]: https://github.com/MetaMask/github-tools/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/MetaMask/github-tools/releases/tag/v1.0.0
Loading