Skip to content

Commit ada5ebb

Browse files
committed
Merge branch 'main' into v2
2 parents cb68a32 + da6f095 commit ada5ebb

File tree

7 files changed

+22
-14
lines changed

7 files changed

+22
-14
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
"@typescript-eslint/type-annotation-spacing": "error",
4848
"@typescript-eslint/unbound-method": "error",
4949
"no-console": "off",
50-
"import/no-commonjs": "off"
50+
"import/no-commonjs": "off",
51+
"github/no-then": "off"
5152
},
5253
"env": {
5354
"node": true,

.github/workflows/codeball.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
with:
2828
name: "codeball:approved"
2929
color: "86efac" # green
30+
codeball-job-id: ${{ steps.codeball_baller.outputs.codeball-job-id }}
31+
3032

3133
# If Codeball did not approve the contribution, add a "codeball:needs-review" label
3234
- name: Label Approved
@@ -35,8 +37,11 @@ jobs:
3537
with:
3638
name: "codeball:needs-review"
3739
color: "bfdbfe" # blue
40+
codeball-job-id: ${{ steps.codeball_baller.outputs.codeball-job-id }}
3841

3942
# If Codeball approved the contribution, approve the PR
4043
- name: Approve PR
4144
uses: sturdy-dev/codeball-action/approver@v2
4245
if: ${{ steps.codeball_status.outputs.approved == 'true' }}
46+
with:
47+
codeball-job-id: ${{ steps.codeball_baller.outputs.codeball-job-id }}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
![github_bg](https://user-images.githubusercontent.com/47952/170700847-bb0cac65-f269-4758-955a-632c48f47290.png)
22

3+
Test :-)
4+
35
# CODEBALL — AI CODE REVIEW 🔮
46

57
Codeball is a code review AI which approves Pull Requests that a human would have approved. Spend less time waiting, save time and money.

src/approver/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async function run(): Promise<void> {
3636
}
3737

3838
run()
39-
.then(() => track({jobID, actionName: 'approver'}))
39+
.then(async () => await track({jobID, actionName: 'approver'}))
4040
.catch(error => {
4141
if (error instanceof Error) {
4242
track({jobID, actionName: 'approver', error: error.message})

src/baller/main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ async function run(): Promise<{jobId: string}> {
2222
}
2323

2424
run()
25-
.then(({jobId}) => {
26-
track({jobID: jobId, actionName: 'baller'})
25+
.then(async ({jobId}) => {
26+
await track({jobID: jobId, actionName: 'baller'})
2727
core.setOutput('codeball-job-id', jobId)
2828
})
29-
.catch(error => {
30-
track({actionName: 'baller', error: error.message})
29+
.catch(async error => {
30+
await track({actionName: 'baller', error: error.message})
3131
if (error instanceof Error) {
3232
core.setFailed(error.message)
3333
}

src/labeler/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ const run = async (): Promise<void> => {
7373
}
7474

7575
run()
76-
.then(() => track({jobID, actionName: 'labeler'}))
77-
.catch(error => {
76+
.then(async () => await track({jobID, actionName: 'labeler'}))
77+
.catch(async error => {
7878
if (error instanceof Error) {
79-
track({jobID, actionName: 'labeler', error: error.message})
79+
await track({jobID, actionName: 'labeler', error: error.message})
8080
if (error.message === 'Resource not accessible by integration') {
8181
core.setFailed(
8282
'Codeball Labeler failed to access GitHub. Check the "GITHUB_TOKEN Permissions" of this job and make sure that the job has WRITE permissions to Pull Requests.'

src/status/main.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ const run = async (jobID: string): Promise<boolean> => {
2828
const jobID = required('codeball-job-id')
2929

3030
run(jobID)
31-
.then(isApproved => {
32-
track({jobID, actionName: 'status'})
33-
core.setOutput('approved', isApproved)
31+
.then(async approved => {
32+
await track({jobID, actionName: 'status'})
33+
core.setOutput('approved', approved)
3434
})
35-
.catch(error => {
35+
.catch(async error => {
3636
if (error instanceof Error) {
37-
track({jobID, actionName: 'status', error: error.message})
37+
await track({jobID, actionName: 'status', error: error.message})
3838
core.setFailed(error.message)
3939
}
4040
})

0 commit comments

Comments
 (0)