Skip to content

short circuit if there is no change between source and destination branch#68

Merged
abbiejones merged 2 commits intomasterfrom
do-not-fail-on-no-op-merge
Apr 20, 2026
Merged

short circuit if there is no change between source and destination branch#68
abbiejones merged 2 commits intomasterfrom
do-not-fail-on-no-op-merge

Conversation

@abbiejones
Copy link
Copy Markdown
Contributor

There is a bug in the "merge" Github Action causing it to fail when there is no difference between the source branch and destination branch. See this GHA output for reference: https://github.com/OpenSesame/Catalog/actions/runs/24209438648/job/72192345956?pr=17939

{"base":"develop","head":"OpenSesame:refs/heads/release/0000","maintainer_can_modify":true,"title":"Automated Merge"}
< HTTP 422
{"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"No commits between develop and release/0000"}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request","status":"422"}
Error creating pull request: Unprocessable Entity (HTTP 422)
No commits between develop and release/0000
Failed to get PR URL for merge of refs/heads/release/0000 into develop
One or more merges failed:
 - develop

Because there are no commits between the source and destination, it fails to create a PR to merge downstream changes.

This PR fixes that issue by short circuiting when source and destination are the same.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes the merge GitHub Action failing when attempting to open a PR between identical source/destination branches by short-circuiting no-op merges before PR creation.

Changes:

  • Derive the source branch name from GITHUB_REF within open_and_merge_pull_request.
  • Add an “ahead commits” check to skip PR creation when the source branch has no commits ahead of the destination branch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread merge/entrypoint.sh
Comment thread merge/entrypoint.sh
@abbiejones abbiejones merged commit 3c68089 into master Apr 20, 2026
1 check passed
@abbiejones abbiejones deleted the do-not-fail-on-no-op-merge branch April 20, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants