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 3131 with :
3232 name : " codeball:approved"
3333 color : " 86efac" # green
34+ codeball-job-id : ${{ steps.codeball_baller.outputs.codeball-job-id }}
3435
3536 # If Codeball approved the contribution, approve the PR
3637 - name : Approve PR
3738 uses : sturdy-dev/codeball-action/approver@v2
3839 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:
1414 description : ' The message to send in the code review comment.'
1515 default : " Codeball: LGTM! :+1:"
1616 required : false
17+ codeball-job-id :
18+ description : ' The ID of the Codeball Job created by the Baller Action'
19+ required : false
1720
1821runs :
1922 using : ' node16'
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ inputs:
2121 description : " The description of the label."
2222 default : " Codeball"
2323 required : false
24+ codeball-job-id :
25+ description : ' The ID of the Codeball Job created by the Baller Action'
26+ required : false
2427
2528runs :
2629 using : ' node16'
Original file line number Diff line number Diff line change 11import * as core from '@actions/core'
22import * as github from '@actions/github'
33import { Octokit } from '../lib'
4+ import { track } from '../lib/track/track'
45
56async function run ( ) : Promise < void > {
67 try {
@@ -35,6 +36,8 @@ async function run(): Promise<void> {
3536 return
3637 }
3738
39+ const jobID = core . getInput ( 'codeball-job-id' ) // jobID is not required
40+
3841 const octokit = new Octokit ( { auth : githubToken } )
3942
4043 await octokit . pulls . createReview ( {
@@ -45,6 +48,8 @@ async function run(): Promise<void> {
4548 body : 'Codeball: LGTM! :+1:' ,
4649 event : 'APPROVE'
4750 } )
51+
52+ await track ( jobID , 'approver' )
4853 } catch ( error ) {
4954 if ( error instanceof Error ) {
5055 if ( error . message === 'Resource not accessible by integration' ) {
Original file line number Diff line number Diff line change 11import * as core from '@actions/core'
22import * as github from '@actions/github'
33import { create } from '../lib'
4+ import { track } from '../lib/track/track'
45
56async function run ( ) : Promise < void > {
67 try {
@@ -25,6 +26,8 @@ async function run(): Promise<void> {
2526
2627 core . info ( `Job created: ${ job . id } ` )
2728 core . setOutput ( 'codeball-job-id' , job . id )
29+
30+ await track ( job . id , 'baller' )
2831 } catch ( error ) {
2932 if ( error instanceof Error ) core . setFailed ( error . message )
3033 }
Original file line number Diff line number Diff line change 11import * as core from '@actions/core'
22import * as github from '@actions/github'
33import { Octokit } from '../lib'
4+ import { track } from '../lib/track/track'
45
56async function run ( ) : Promise < void > {
67 try {
@@ -39,6 +40,8 @@ async function run(): Promise<void> {
3940 const labelColor = core . getInput ( 'color' )
4041 const labelDescription = core . getInput ( 'description' )
4142
43+ const jobID = core . getInput ( 'codeball-job-id' ) // jobID is not required
44+
4245 const octokit = new Octokit ( { auth : githubToken } )
4346
4447 core . debug ( `Adding label "${ labelName } " to PR ${ pullRequestURL } ` )
@@ -82,6 +85,8 @@ async function run(): Promise<void> {
8285
8386 core . debug ( `Add label: ${ JSON . stringify ( addLabelParams ) } ` )
8487 await octokit . issues . addLabels ( addLabelParams )
88+
89+ await track ( jobID , 'labeler' )
8590 } catch ( error ) {
8691 if ( error instanceof Error ) {
8792 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 11import { isContributionJob , isFinalStatus , get } from '../lib'
22import * as core from '@actions/core'
3+ import { track } from '../lib/track/track'
34
45async function run ( ) : Promise < void > {
56 try {
@@ -40,6 +41,8 @@ async function run(): Promise<void> {
4041 }
4142
4243 core . setOutput ( 'approved' , false )
44+
45+ await track ( jobID , 'status' )
4346 } catch ( error ) {
4447 if ( error instanceof Error ) {
4548 core . setFailed ( error . message )
You can’t perform that action at this time.
0 commit comments