Skip to content

Commit dc09004

Browse files
committed
fix: add post-steps for draft→ready→Copilot review→auto-merge cycle
Both gh-aw workflows now use post-steps to: 1. Find the draft PR created by safe-outputs 2. Mark it ready for review (gh pr ready) 3. Request Copilot review (@copilot) 4. Enable auto-merge (--auto, waits for approval before merging) Removed merge logic from agent instructions — agent creates the draft PR, post-steps handles the review/merge lifecycle. PR only merges after Copilot approves.
1 parent e4ebdd9 commit dc09004

5 files changed

Lines changed: 79 additions & 77 deletions

File tree

.github/workflows/daily-intelligence.lock.yml

Lines changed: 18 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/daily-intelligence.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,23 @@ safe-outputs:
5353
add-labels:
5454
allowed: [automated, reference-update, intelligence]
5555
max: 5
56+
57+
post-steps:
58+
- name: Mark draft PR ready and request Copilot review with auto-merge
59+
env:
60+
GH_TOKEN: ${{ github.token }}
61+
run: |
62+
PR=$(gh pr list --repo "$GITHUB_REPOSITORY" --base develop --search "docs(references): daily intelligence" --state open --json number --jq '.[0].number')
63+
if [ -n "$PR" ]; then
64+
echo "Found PR #$PR"
65+
gh pr ready "$PR" --repo "$GITHUB_REPOSITORY" || true
66+
echo "PR #$PR marked ready for review"
67+
gh pr edit "$PR" --repo "$GITHUB_REPOSITORY" --add-reviewer "@copilot" 2>/dev/null || echo "Copilot reviewer not available"
68+
echo "Requested Copilot review on PR #$PR"
69+
gh pr merge "$PR" --repo "$GITHUB_REPOSITORY" --squash --auto --delete-branch || echo "Auto-merge enabled (will merge when approved)"
70+
else
71+
echo "No draft PR found"
72+
fi
5673
---
5774

5875
# Daily Intelligence Pipeline Agent
@@ -187,11 +204,7 @@ Create a **draft** PR to `develop` using the `create-pull-request` safe-output:
187204
- Base: `develop`
188205
- Labels: `automated`, `reference-update`
189206

190-
The PR is created as a draft (frontmatter `draft: true`). After all changes are pushed and verified, mark it ready for review:
191-
192-
```bash
193-
gh pr ready <PR_NUMBER>
194-
```
207+
The PR is created as a draft (frontmatter `draft: true`). The `post-steps` block automatically marks it ready for review after safe-outputs complete. Do NOT merge — merging is a separate review decision.
195208

196209
### Phase 8: Summary
197210

0 commit comments

Comments
 (0)