Skip to content

Commit c88927c

Browse files
committed
feat: Auto-merge AICODE PRs after tests pass
- Added auto-merge step using gh CLI - Merges with --squash to keep clean history - Uses --auto flag for automatic merge when ready - Updated Slack notification to say 'merged' instead of 'created' - Only merges if tests pass and PR is created successfully PRs are now fully autonomous: create → test → merge
1 parent 5675fda commit c88927c

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/aicode-agent.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,26 @@ jobs:
8080
title: "AICODE: ${{ github.event.client_payload.task }}"
8181
body: |
8282
Autonomous code changes requested by @${{ github.event.client_payload.requester }}
83-
83+
8484
**Task:** ${{ github.event.client_payload.task }}
8585
**Tests:** ✅ Passed
8686
**Agent Run:** ${{ github.run_id }}
87-
88-
Review the changes carefully before merging.
87+
88+
This PR will be automatically merged.
89+
90+
- name: Auto-merge PR
91+
if: steps.agent.outcome == 'success' && steps.tests.outcome == 'success' && steps.cpr.outputs.pull-request-number != ''
92+
run: |
93+
gh pr merge ${{ steps.cpr.outputs.pull-request-number }} --squash --auto
94+
env:
95+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8996

9097
- name: Notify Slack on success
9198
if: steps.agent.outcome == 'success' && steps.tests.outcome == 'success'
9299
run: |
93100
curl -X POST "${{ secrets.SLACK_WEBHOOK_URL }}" \
94101
-H "Content-Type: application/json" \
95-
-d "{\"text\":\"✅ AICODE PR created: <https://github.com/htilly/SlackONOS/pull/${{ steps.cpr.outputs.pull-request-number }}|#${{ steps.cpr.outputs.pull-request-number }}>\"}"
102+
-d "{\"text\":\"✅ AICODE PR merged: <https://github.com/htilly/SlackONOS/pull/${{ steps.cpr.outputs.pull-request-number }}|#${{ steps.cpr.outputs.pull-request-number }}>\"}"
96103
97104
- name: Notify Slack on test failure
98105
if: steps.agent.outcome == 'success' && steps.tests.outcome != 'success'

0 commit comments

Comments
 (0)