Skip to content

Update develop: improve PR body handling and auto-merge conditions#10

Merged
The0mikkel merged 3 commits intomainfrom
develop
Nov 16, 2025
Merged

Update develop: improve PR body handling and auto-merge conditions#10
The0mikkel merged 3 commits intomainfrom
develop

Conversation

@The0mikkel
Copy link
Member

No description provided.

@The0mikkel The0mikkel self-assigned this Nov 16, 2025
Copilot AI review requested due to automatic review settings November 16, 2025 15:56
Copy link
Contributor

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 improves the GitHub Actions workflow for updating the develop branch by refactoring PR body construction and adding null-safety checks for the auto-merge input parameter.

  • Refactored PR body construction to conditionally append custom description
  • Added null checks to auto-merge conditions to handle cases where the input is not provided

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

Copy link
Contributor

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 2 comments.


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

# Auto merge handling
- name: "Check if latest commit was a merge commit from develop"
if: steps.create_pr.outputs.URL != '' && inputs.auto_merge == true
if: steps.create_pr.outputs.URL != '' && inputs.auto_merge != false
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

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

The condition inputs.auto_merge != false is problematic because when inputs.auto_merge is not provided (null/empty), the comparison != false evaluates to true, which means this step will run even when auto_merge is not explicitly set. This changes the behavior from the original == true condition, which would only run when auto_merge is explicitly true (or uses the default value of true).

In GitHub Actions, when comparing boolean inputs, you should use string comparisons. The correct condition should be: inputs.auto_merge == true || inputs.auto_merge == 'true' if you want to handle both boolean and string representations, or keep the original == true if the default value handling is sufficient.

Suggested change
if: steps.create_pr.outputs.URL != '' && inputs.auto_merge != false
if: steps.create_pr.outputs.URL != '' && (inputs.auto_merge == true || inputs.auto_merge == 'true')

Copilot uses AI. Check for mistakes.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Auto-merge Pull Request"
if: steps.check_merge_source.outputs.latest_from_develop == 'true'
if: steps.check_merge_source.outputs.latest_from_develop == 'true' && inputs.auto_merge != false
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

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

The condition inputs.auto_merge != false has the same issue as line 141. When inputs.auto_merge is not provided or is null, this comparison evaluates to true, allowing auto-merge to proceed even when it shouldn't.

Additionally, this creates an inconsistency: if the condition on line 141 is changed to properly handle the auto_merge input, this line must also be updated to match. Consider using inputs.auto_merge == true to maintain consistency with the input definition which has default: true.

Copilot uses AI. Check for mistakes.
@The0mikkel The0mikkel merged commit 1c15a00 into main Nov 16, 2025
11 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.

1 participant