Fix podcast trigger to use publish branch article (#535) (#536)

Closes #535. Fixes podcast trigger to use publish branch article with proper auto-merge guard.

Juan Manuel Servera committed Jun 25, 2026 at 13:10 UTC b8215d859e86dbabeb1281c3764504f8260c24ec
1 file changed +11 -3
.github/workflows/sync-publish-to-main.yml
+11 -3
@@ -119,9 +119,11 @@ jobs:
119 exit 1
120 fi
121
122 - # Enable auto-merge so the sync PR squashes into main as soon as its
123 - # required checks pass, without waiting for manual intervention.
124 - gh pr merge "$PR_NUMBER" --auto --squash || echo "::notice::Auto-merge request failed for PR #${PR_NUMBER} — will attempt explicit merge later"
122 + # Short-circuit if the PR has already been merged (e.g. by a prior run).
123 + if [ "$(gh pr view "$PR_NUMBER" --json state --jq '.state')" = "MERGED" ]; then
124 + echo "::notice::PR #${PR_NUMBER} is already merged; nothing to do."
125 + exit 0
126 + fi
127
128 HEAD_SHA=$(git rev-parse HEAD)
129 CHECK_COUNT=0
@@ -139,6 +141,12 @@ jobs:
141 exit 1
142 fi
143
144 + # Only now that we have confirmed required checks are configured do we
145 + # enable auto-merge, so the PR cannot merge immediately by bypassing the
146 + # "refusing to merge without validation" guard above. Emit a warning (not
147 + # a silent `|| true`) if auto-merge cannot be enabled.
148 + gh pr merge "$PR_NUMBER" --auto --squash || echo "::warning::Could not enable auto-merge for PR #${PR_NUMBER} — will attempt explicit merge after checks pass."
149 +
150 gh pr checks "$PR_NUMBER" --watch --fail-fast
151 # Auto-merge may have already squashed the PR once checks passed; if the
152 # explicit merge fails, confirm the PR did in fact merge before succeeding.