Skip to content

GODRIVER-3797 Skip manual merge on dry run.#101

Merged
qingyang-hu merged 2 commits intomongodb-labs:mainfrom
qingyang-hu:godriver3797
Jan 28, 2026
Merged

GODRIVER-3797 Skip manual merge on dry run.#101
qingyang-hu merged 2 commits intomongodb-labs:mainfrom
qingyang-hu:godriver3797

Conversation

@qingyang-hu
Copy link
Collaborator

GODRIVER-3797
Skip manual merge on dry run.

Copy link

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

This PR adds a dry run check to skip the manual merge operation in the Go driver's pre-publish action. The change prevents the action from performing git merge and push operations when running in dry run mode, which is consistent with the behavior of similar actions in the codebase.

Changes:

  • Added inputs.dry_run == 'false' condition to the "Manually merge up changes" step to prevent merge operations during dry runs

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

ignoredBranches: ${{ inputs.ignored_branches }}
- name: "Manually merge up changes"
if: ${{ inputs.push_changes == 'true' && ! contains(fromJSON(inputs.ignored_branches), github.ref_name) && steps.get-next-branch.outputs.hasNextBranch }}
if: ${{ inputs.dry_run == 'false' && inputs.push_changes == 'true' && ! contains(fromJSON(inputs.ignored_branches), github.ref_name) && steps.get-next-branch.outputs.hasNextBranch }}
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The dry_run input is used in the conditional but is not defined in the inputs section of this action. This will cause the action to fail when invoked.

To fix this, add the dry_run input definition to the inputs section, similar to how it's defined in other actions in the codebase (e.g., python/pre-publish/action.yml:18-20, ruby/publish/action.yml:23-25). The input should be required and have a description explaining its purpose.

Copilot uses AI. Check for mistakes.
Copy link

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


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

ignoredBranches: ${{ inputs.ignored_branches }}
- name: "Manually merge up changes"
if: ${{ inputs.push_changes == 'true' && ! contains(fromJSON(inputs.ignored_branches), github.ref_name) && steps.get-next-branch.outputs.hasNextBranch }}
if: ${{ inputs.dry_run == 'false' && inputs.push_changes == 'true' && ! contains(fromJSON(inputs.ignored_branches), github.ref_name) && steps.get-next-branch.outputs.hasNextBranch }}
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

Consider also adding the dry_run check to the "Determine branch to merge up to" step condition (line 32) to avoid unnecessary computation. When dry_run is true, this step will execute but its output won't be used since the merge step is now skipped. The condition on line 32 could become: inputs.dry_run == 'false' && inputs.push_changes == 'true' && ! contains(fromJSON(inputs.ignored_branches), github.ref_name) for consistency and efficiency.

Copilot uses AI. Check for mistakes.
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

LGTM!

@qingyang-hu qingyang-hu merged commit 9e807b4 into mongodb-labs:main Jan 28, 2026
12 checks passed
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