Skip to content

Commit 03776d7

Browse files
author
Diego Manzanarez
committed
Moved package json to workflows folder and removed unused dependencies
1 parent e7ff815 commit 03776d7

4 files changed

Lines changed: 27 additions & 23 deletions

File tree

.github/workflows/create_job.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ const client = new CloudTasksClient();
66
const 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
}

.github/workflows/invoke_test_runner.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
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
@@ -22,6 +25,7 @@ env:
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

.github/workflows/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
}

package.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)