You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collapse the three near-identical gh pr comment call sites into a single
comment_pr helper, centralizing the best-effort (|| true) semantics in one
place. No behavioral change.
echo "::error::merge_commit_sha is empty; cannot backport."
76
79
exit 1
@@ -111,8 +114,7 @@ jobs:
111
114
# Ensure origin/<base> exists locally for the worktree; a missing branch fails just this base, not the run.
112
115
if ! git fetch --no-tags origin "+refs/heads/${base}:refs/remotes/origin/${base}"; then
113
116
echo "::error::Target branch ${base} does not exist on origin; skipping."
114
-
gh pr comment "${PR_NUMBER}" --repo "${REPO}" \
115
-
--body "⚠️ Automatic backport to \`${base}\` skipped: the target branch does not exist." || true
117
+
comment_pr "⚠️ Automatic backport to \`${base}\` skipped: the target branch does not exist."
116
118
overall_rc=1
117
119
continue
118
120
fi
@@ -126,13 +128,11 @@ jobs:
126
128
pr_url="$(gh pr list --repo "${REPO}" --head "${branch}" --state open --json url --jq '.[0].url // ""' || true)"
127
129
echo "::notice::Opened backport PR for ${base}: ${pr_url}"
128
130
if [ -n "${pr_url}" ]; then
129
-
gh pr comment "${PR_NUMBER}" --repo "${REPO}" \
130
-
--body "Backport to \`${base}\` opened: ${pr_url}" || true
131
+
comment_pr "Backport to \`${base}\` opened: ${pr_url}"
131
132
fi
132
133
else
133
134
echo "::error::Backport to ${base} failed."
134
-
gh pr comment "${PR_NUMBER}" --repo "${REPO}" \
135
-
--body "⚠️ Automatic backport to \`${base}\` failed. See the [workflow run](${RUN_URL}) for details, or backport manually with \`ddev release port-commit PR-${PR_NUMBER} --target-branch ${base}\`." || true
135
+
comment_pr "⚠️ Automatic backport to \`${base}\` failed. See the [workflow run](${RUN_URL}) for details, or backport manually with \`ddev release port-commit PR-${PR_NUMBER} --target-branch ${base}\`."
0 commit comments