From b01bf24ca5d7e261644ddf53c872776713369b80 Mon Sep 17 00:00:00 2001 From: The0Mikkel Date: Sun, 16 Nov 2025 16:56:05 +0100 Subject: [PATCH 1/2] fix(develop-update): improve PR body handling and auto-merge conditions --- .github/workflows/develop-update.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/develop-update.yml b/.github/workflows/develop-update.yml index a278dcc..fbc7815 100644 --- a/.github/workflows/develop-update.yml +++ b/.github/workflows/develop-update.yml @@ -126,14 +126,18 @@ 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 "${{ inputs.pr_description }}" ]; then + PR_BODY="${PR_BODY}"$'\n\n'"${{ inputs.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 }} # 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 == true || inputs.auto_merge == null) id: check_merge_source run: | # Check if latest commit is a merge commit @@ -176,7 +180,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 == true || inputs.auto_merge == null) 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: From eea0830418343308ff60d10722a9e8a0bbf8db63 Mon Sep 17 00:00:00 2001 From: The0Mikkel Date: Sun, 16 Nov 2025 17:02:43 +0100 Subject: [PATCH 2/2] fix(develop-update): improve PR body handling and auto-merge conditions --- .github/workflows/develop-update.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/develop-update.yml b/.github/workflows/develop-update.yml index fbc7815..4e2bdb7 100644 --- a/.github/workflows/develop-update.yml +++ b/.github/workflows/develop-update.yml @@ -127,17 +127,18 @@ jobs: if: steps.check_diff.outputs.diff == 'true' && steps.check_pr.outputs.result == 'false' run: | PR_BODY='Merge main into develop to update the develop branch to the latest version' - if [ -n "${{ inputs.pr_description }}" ]; then - PR_BODY="${PR_BODY}"$'\n\n'"${{ inputs.pr_description }}" + 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 || inputs.auto_merge == null) + if: steps.create_pr.outputs.URL != '' && inputs.auto_merge != false id: check_merge_source run: | # Check if latest commit is a merge commit @@ -180,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' && (inputs.auto_merge == true || inputs.auto_merge == null) + if: steps.check_merge_source.outputs.latest_from_develop == 'true' && inputs.auto_merge != false 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: