Skip to content

Commit 82f1952

Browse files
jluque0101Qbandev
andauthored
Fix: Prevent changelog PR creation when branches are in sync (#177)
* Fix: Prevent changelog PR creation when branches are in sync * chore: run prettier * fix: update CHANGELOG.md links for v1.1.2 --------- Co-authored-by: Qbandev <[email protected]>
1 parent 2bfc139 commit 82f1952

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

.github/scripts/update-release-changelog.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,27 @@ commit_and_push_changelog() {
166166
if [[ "${previous_version_ref,,}" == "null" ]]; then
167167
commit_msg="${commit_msg} (hotfix - no test plan)"
168168
fi
169-
if ! git commit -am "${commit_msg}"; then
169+
170+
local changes_committed=false
171+
if git commit -am "${commit_msg}"; then
172+
changes_committed=true
173+
else
170174
echo "No changes detected; skipping commit."
171175
fi
172176

177+
# Check if there are any differences between the changelog branch and release branch
178+
if ! ${changes_committed}; then
179+
echo "Checking for differences between ${changelog_branch} and ${release_branch}.."
180+
if ! git diff --quiet "origin/${release_branch}" "HEAD"; then
181+
echo "Differences found between branches; proceeding with PR creation."
182+
else
183+
echo "No differences between ${changelog_branch} and ${release_branch}."
184+
echo "Branches are already in sync; skipping PR creation."
185+
echo "Changelog workflow completed successfully (no updates needed)."
186+
return 0
187+
fi
188+
fi
189+
173190
local pr_body="This PR updates the change log for ${version}."
174191
if [[ "${previous_version_ref,,}" == "null" ]]; then
175192
pr_body="${pr_body} (Hotfix - no test plan generated.)"

CHANGELOG.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Added
1313

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

16-
### Changed
17-
18-
- 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))
16+
### Changed
1917

18+
- 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))
2019

2120
## [1.1.0]
2221

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

49-
[Unreleased]: https://github.com/MetaMask/github-tools/compare/v1.1.0...HEAD
48+
[Unreleased]: https://github.com/MetaMask/github-tools/compare/v1.1.2...HEAD
49+
[1.1.2]: https://github.com/MetaMask/github-tools/compare/v1.1.0...v1.1.2
5050
[1.1.0]: https://github.com/MetaMask/github-tools/compare/v1.0.0...v1.1.0
5151
[1.0.0]: https://github.com/MetaMask/github-tools/releases/tag/v1.0.0

0 commit comments

Comments
 (0)