|
1 | 1 | # See https://github.com/sturdy-dev/codeball-action for more information of how to use this action |
2 | 2 | name: Codeball AI Actions |
3 | | -description: AI Code Review |
| 3 | +description: AI Code Review – Codeball approves Pull Requests that a human would have approved. Wait less for review, save time and $$$. |
4 | 4 |
|
5 | 5 | author: Sturdy |
6 | 6 | branding: |
7 | 7 | icon: check |
8 | 8 | color: orange |
9 | 9 |
|
10 | | -inputs: |
11 | | - do-label: |
12 | | - description: 'If "true", the action will label Pull Request if Codeball AI approves the contribution' |
13 | | - default: "true" |
14 | | - required: false |
15 | | - label-name: |
16 | | - description: 'Label value to be set.' |
17 | | - default: 'codeball:approved' |
18 | | - required: false |
19 | | - do-approve: |
20 | | - description: 'If "true", the action will submit an approving Pull Request review if Codeball AI approves the contribution' |
21 | | - default: "true" |
22 | | - required: false |
23 | | - |
24 | 10 | runs: |
25 | 11 | using: 'composite' |
26 | 12 | steps: |
| 13 | + |
27 | 14 | # Start a new Codeball review job |
28 | 15 | # This step is asynchronous and will return a job id |
29 | 16 | - name: Trigger Codeball |
30 | 17 | id: codeball_baller |
31 | | - uses: sturdy-dev/codeball-action/baller@v1 |
| 18 | + uses: sturdy-dev/codeball-action/baller@v2 |
32 | 19 |
|
33 | | - # Wait for the codeball_baller job to complete |
34 | | - # Approves the Pull Request if Codeball approves it |
35 | | - - name: Codeball Approver |
36 | | - id: codeball_approver |
37 | | - uses: sturdy-dev/codeball-action/approver@v1 |
| 20 | + # Wait for Codeball to return the status |
| 21 | + - name: Get Status |
| 22 | + id: codeball_status |
| 23 | + uses: sturdy-dev/codeball-action/status@v2 |
38 | 24 | with: |
39 | 25 | codeball-job-id: ${{ steps.codeball_baller.outputs.codeball-job-id }} |
40 | | - do-label: ${{ inputs.do-label }} |
41 | | - label-name: ${{ inputs.label-name }} |
42 | | - do-approve: ${{ inputs.do-approve }} |
| 26 | + |
| 27 | + # If Codeball approved the contribution, add a "codeball:approved" label |
| 28 | + - name: Label Approved |
| 29 | + uses: sturdy-dev/codeball-action/labeler@v2 |
| 30 | + if: ${{ steps.codeball_status.outputs.approved == 'true' }} |
| 31 | + with: |
| 32 | + name: "codeball:approved" |
| 33 | + color: "86efac" # green |
| 34 | + |
| 35 | + # If Codeball approved the contribution, approve the PR |
| 36 | + - name: Approve PR |
| 37 | + uses: sturdy-dev/codeball-action/approver@v2 |
| 38 | + if: ${{ steps.codeball_status.outputs.approved == 'true' }} |
0 commit comments