File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,14 +6,16 @@ const client = new CloudTasksClient();
66const constructPayload = ( ) => {
77 const jobId = String ( uuidv4 ( ) ) ;
88 const commitHash = process . env . COMMIT_HASH ;
9+ const branch = process . env . BRANCH ;
910 const classes = process . env . CLASSES ;
1011 const pullRequestNumber = process . env . PULL_REQUEST_NUMBER ;
1112
1213 const payloadStructure = {
1314 "jobId" : jobId ,
14- "commitHash" : commitHash ,
15+ "commitHash" : commitHash . trim ( ) ,
16+ "branch" : branch . trim ( ) ,
1517 "classes" : convertClassesStringToArray ( classes ) ,
16- "pullRequest" : pullRequestNumber ,
18+ "pullRequest" : pullRequestNumber . trim ( ) ,
1719 }
1820 return payloadStructure ;
1921}
Original file line number Diff line number Diff line change 55 - master
66 workflow_dispatch :
77 inputs :
8+ BRANCH_INPUT :
9+ description : ' Branch'
10+ required : true
811 COMMIT_HASH_INPUT :
912 description : ' Commit hash'
1013 required : true
2225 WORKFLOW_URL : ${{ secrets.WORKFLOW_URL }}
2326 # Payload variables
2427 COMMIT_HASH : ${{ (github.sha) }}
28+ BRANCH : ${{ (github.ref_name) }}
2529 CLASSES : ${{ (github.event.inputs.CLASSES_TO_EXECUTE_INPUT) }}
2630 PULL_REQUEST_NUMBER : ${{ (github.event.inputs.PULL_REQUEST_NUMBER_INPUT) }}
2731
@@ -33,12 +37,16 @@ jobs:
3337 - uses : actions/setup-node@v3
3438 with :
3539 node-version : ' 14'
36- - run : npm install
40+ - run : npm install --prefix .github/workflows
3741
3842 - name : Update COMMIT_HASH
3943 if : ${{ github.event_name == 'workflow_dispatch' }}
4044 run : echo "COMMIT_HASH=${{ (github.event.inputs.COMMIT_HASH_INPUT) }} " >> $GITHUB_ENV
4145
46+ - name : Update BRANCH
47+ if : ${{ github.event_name == 'workflow_dispatch' }}
48+ run : echo "BRANCH=${{ (github.event.inputs.BRANCH_INPUT) }} " >> $GITHUB_ENV
49+
4250 - id : ' auth'
4351 name : ' Authenticate to Google Cloud'
4452 uses : google-github-actions/auth@v0.4.0
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " workflow-testrunner-tasksenqueuer" ,
3+ "private" : true ,
4+ "engines" : {
5+ "node" : " >=12.0.0"
6+ },
7+ "files" : [
8+ " *.js"
9+ ],
10+ "dependencies" : {
11+ "@google-cloud/tasks" : " ^3.0.0" ,
12+ "uuid" : " ^8.0.0"
13+ }
14+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments