File tree Expand file tree Collapse file tree 8 files changed +33
-0
lines changed Expand file tree Collapse file tree 8 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 31
31
with :
32
32
name : " codeball:approved"
33
33
color : " 86efac" # green
34
+ codeball-job-id : ${{ steps.codeball_baller.outputs.codeball-job-id }}
34
35
35
36
# If Codeball approved the contribution, approve the PR
36
37
- name : Approve PR
37
38
uses : sturdy-dev/codeball-action/approver@v2
38
39
if : ${{ steps.codeball_status.outputs.approved == 'true' }}
40
+ with :
41
+ codeball-job-id : ${{ steps.codeball_baller.outputs.codeball-job-id }}
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ inputs:
14
14
description : ' The message to send in the code review comment.'
15
15
default : " Codeball: LGTM! :+1:"
16
16
required : false
17
+ codeball-job-id :
18
+ description : ' The ID of the Codeball Job created by the Baller Action'
19
+ required : false
17
20
18
21
runs :
19
22
using : ' node16'
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ inputs:
21
21
description : " The description of the label."
22
22
default : " Codeball"
23
23
required : false
24
+ codeball-job-id :
25
+ description : ' The ID of the Codeball Job created by the Baller Action'
26
+ required : false
24
27
25
28
runs :
26
29
using : ' node16'
Original file line number Diff line number Diff line change 1
1
import * as core from '@actions/core'
2
2
import * as github from '@actions/github'
3
3
import { Octokit } from '../lib'
4
+ import { track } from '../lib/track/track'
4
5
5
6
async function run ( ) : Promise < void > {
6
7
try {
@@ -35,6 +36,8 @@ async function run(): Promise<void> {
35
36
return
36
37
}
37
38
39
+ const jobID = core . getInput ( 'codeball-job-id' ) // jobID is not required
40
+
38
41
const octokit = new Octokit ( { auth : githubToken } )
39
42
40
43
await octokit . pulls . createReview ( {
@@ -45,6 +48,8 @@ async function run(): Promise<void> {
45
48
body : 'Codeball: LGTM! :+1:' ,
46
49
event : 'APPROVE'
47
50
} )
51
+
52
+ await track ( jobID , 'approver' )
48
53
} catch ( error ) {
49
54
if ( error instanceof Error ) {
50
55
if ( error . message === 'Resource not accessible by integration' ) {
Original file line number Diff line number Diff line change 1
1
import * as core from '@actions/core'
2
2
import * as github from '@actions/github'
3
3
import { create } from '../lib'
4
+ import { track } from '../lib/track/track'
4
5
5
6
async function run ( ) : Promise < void > {
6
7
try {
@@ -25,6 +26,8 @@ async function run(): Promise<void> {
25
26
26
27
core . info ( `Job created: ${ job . id } ` )
27
28
core . setOutput ( 'codeball-job-id' , job . id )
29
+
30
+ await track ( job . id , 'baller' )
28
31
} catch ( error ) {
29
32
if ( error instanceof Error ) core . setFailed ( error . message )
30
33
}
Original file line number Diff line number Diff line change 1
1
import * as core from '@actions/core'
2
2
import * as github from '@actions/github'
3
3
import { Octokit } from '../lib'
4
+ import { track } from '../lib/track/track'
4
5
5
6
async function run ( ) : Promise < void > {
6
7
try {
@@ -39,6 +40,8 @@ async function run(): Promise<void> {
39
40
const labelColor = core . getInput ( 'color' )
40
41
const labelDescription = core . getInput ( 'description' )
41
42
43
+ const jobID = core . getInput ( 'codeball-job-id' ) // jobID is not required
44
+
42
45
const octokit = new Octokit ( { auth : githubToken } )
43
46
44
47
core . debug ( `Adding label "${ labelName } " to PR ${ pullRequestURL } ` )
@@ -82,6 +85,8 @@ async function run(): Promise<void> {
82
85
83
86
core . debug ( `Add label: ${ JSON . stringify ( addLabelParams ) } ` )
84
87
await octokit . issues . addLabels ( addLabelParams )
88
+
89
+ await track ( jobID , 'labeler' )
85
90
} catch ( error ) {
86
91
if ( error instanceof Error ) {
87
92
if ( error . message === 'Resource not accessible by integration' ) {
Original file line number Diff line number Diff line change
1
+ import { post } from "../api" ;
2
+
3
+ export const track = async ( jobID : string | undefined , actionName : string ) => {
4
+ return post ( "/track" , {
5
+ job_id : jobID ,
6
+ name : actionName ,
7
+ } )
8
+ }
Original file line number Diff line number Diff line change 1
1
import { isContributionJob , isFinalStatus , get } from '../lib'
2
2
import * as core from '@actions/core'
3
+ import { track } from '../lib/track/track'
3
4
4
5
async function run ( ) : Promise < void > {
5
6
try {
@@ -40,6 +41,8 @@ async function run(): Promise<void> {
40
41
}
41
42
42
43
core . setOutput ( 'approved' , false )
44
+
45
+ await track ( jobID , 'status' )
43
46
} catch ( error ) {
44
47
if ( error instanceof Error ) {
45
48
core . setFailed ( error . message )
You can’t perform that action at this time.
0 commit comments