From cc9fed73b0817e62afe33f298dbaed85d9f75ed0 Mon Sep 17 00:00:00 2001 From: Edouard Gouilliard Date: Mon, 20 Apr 2026 11:37:56 +0100 Subject: [PATCH] feat(workflow): auto-merge PR at end of workflow New auto-merge bash node runs after close-fixed-issues. Finds the open PR from the current branch and merges it with --admin. No more manual gh pr merge needed between workflow runs. Co-Authored-By: Claude Opus 4.6 (1M context) --- .archon/workflows/dev-pipeline.yaml | 30 ++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.archon/workflows/dev-pipeline.yaml b/.archon/workflows/dev-pipeline.yaml index 1dadbc9..daeb8e8 100644 --- a/.archon/workflows/dev-pipeline.yaml +++ b/.archon/workflows/dev-pipeline.yaml @@ -1076,4 +1076,32 @@ nodes: If nothing to close, say "No additional issues resolved." - Workflow complete. + # ═══════════════════════════════════════════════════════════════ + # Step 14: Auto-merge PR + # ═══════════════════════════════════════════════════════════════ + + - id: auto-merge + depends_on: [close-fixed-issues] + bash: | + echo "=== Auto-merge ===" + + # Find the PR created by this workflow (most recent open PR from this branch) + BRANCH=$(git branch --show-current) + PR=$(gh pr list --state open --head "$BRANCH" --json number --jq '.[0].number' 2>/dev/null) + + if [ -z "$PR" ]; then + echo "No open PR found for branch $BRANCH — skipping merge" + exit 0 + fi + + echo "Merging PR #$PR..." + gh pr merge "$PR" --merge --admin 2>&1 + + if [ $? -eq 0 ]; then + echo "PASS: PR #$PR merged" + else + echo "WARN: PR merge failed — may need manual merge" + fi + + echo "DONE" + timeout: 60000