|
1 | | -name: Agent |
| 1 | +name: Agent writer |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | issues: |
|
28 | 28 | uses: docker/cagent-action@latest |
29 | 29 | timeout-minutes: 15 |
30 | 30 | with: |
31 | | - cagent-version: v1.22.0 |
32 | 31 | agent: ./tech_writer.yml |
33 | 32 | yolo: true |
34 | 33 | prompt: | |
@@ -68,54 +67,32 @@ jobs: |
68 | 67 | env: |
69 | 68 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
70 | 69 |
|
71 | | - - name: Check for changes |
72 | | - id: changes |
73 | | - run: | |
74 | | - if git diff --quiet; then |
75 | | - echo "has_changes=false" >> $GITHUB_OUTPUT |
76 | | - else |
77 | | - echo "has_changes=true" >> $GITHUB_OUTPUT |
78 | | - fi |
79 | | -
|
80 | | - - name: Commit and push |
81 | | - if: steps.changes.outputs.has_changes == 'true' |
82 | | - env: |
83 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
84 | | - run: | |
85 | | - git config user.name "github-actions[bot]" |
86 | | - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
87 | | -
|
88 | | - BRANCH="agent/issue-${{ github.event.issue.number }}" |
89 | | - git checkout -b "$BRANCH" |
90 | | - git add . |
91 | | - git commit -m "docs: address issue #${{ github.event.issue.number }} |
92 | | -
|
93 | | - This change was automatically generated by the documentation agent team |
94 | | - in response to issue #${{ github.event.issue.number }}. |
95 | | -
|
96 | | - 🤖 Generated with cagent" |
| 70 | + - name: Create pull request |
| 71 | + id: create-pr |
| 72 | + uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 |
| 73 | + with: |
| 74 | + branch: agent/issue-${{ github.event.issue.number }} |
| 75 | + title: "docs: address issue #${{ github.event.issue.number }}" |
| 76 | + body-path: .pr-body.md |
| 77 | + commit-message: | |
| 78 | + docs: address issue #${{ github.event.issue.number }} |
97 | 79 |
|
98 | | - git push origin "$BRANCH" |
| 80 | + This change was automatically generated by the documentation agent team |
| 81 | + in response to issue #${{ github.event.issue.number }}. |
99 | 82 |
|
100 | | - - name: Create pull request |
101 | | - if: steps.changes.outputs.has_changes == 'true' |
102 | | - env: |
103 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
104 | | - run: | |
105 | | - gh pr create \ |
106 | | - --title "docs: address issue #${{ github.event.issue.number }}" \ |
107 | | - --body-file .pr-body.md \ |
108 | | - --label agent/generated |
| 83 | + 🤖 Generated with cagent |
| 84 | + labels: agent/generated |
| 85 | + delete-branch: true |
109 | 86 |
|
110 | 87 | - name: Comment on issue (success) |
111 | | - if: steps.changes.outputs.has_changes == 'true' |
| 88 | + if: steps.create-pr.outputs.pull-request-number |
112 | 89 | env: |
113 | 90 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
114 | 91 | run: | |
115 | 92 | gh issue comment ${{ github.event.issue.number }} --body "✅ The agent team has created a PR to address this issue. Please review when ready." |
116 | 93 |
|
117 | 94 | - name: Comment on issue (no changes) |
118 | | - if: steps.changes.outputs.has_changes == 'false' |
| 95 | + if: "!steps.create-pr.outputs.pull-request-number" |
119 | 96 | env: |
120 | 97 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
121 | 98 | run: | |
|
0 commit comments