Skip to content
Merged
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
11 changes: 8 additions & 3 deletions .github/workflows/develop-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,19 @@ jobs:
id: create_pr
if: steps.check_diff.outputs.diff == 'true' && steps.check_pr.outputs.result == 'false'
run: |
URL=$(gh pr create -B develop -H main --title 'CI: Update develop to match main' --body 'Merge main into develop to update the develop branch to the latest version\n\n${{ inputs.pr_description || '' }}' --label develop-update --label ci)
PR_BODY='Merge main into develop to update the develop branch to the latest version'
if [ -n "$PR_DESCRIPTION" ]; then
PR_BODY="${PR_BODY}"$'\n\n'"${PR_DESCRIPTION}"
fi
URL=$(gh pr create -B develop -H main --title 'CI: Update develop to match main' --body "$PR_BODY" --label develop-update --label ci)
echo "URL=$URL" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_DESCRIPTION: ${{ inputs.pr_description }}

# 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.
id: check_merge_source
run: |
# Check if latest commit is a merge commit
Expand Down Expand Up @@ -176,7 +181,7 @@ jobs:
env:
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.
run: |
gh pr merge "${{ steps.create_pr.outputs.URL }}" -t "chore(ci): Auto update develop to match main [skip ci]" -b "This was done automatically by the CI pipeline" --merge
env:
Expand Down
Loading