From d69ee93ef531c9173038c678e90e82934b0c566c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Alarc=C3=B3n?= <78625129+marcosmicJack@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:43:33 -0500 Subject: [PATCH] Add hash (#3) * Add hash * test16 * update dist * release 18 * update substr * update dist --- dist/index.js | 11 ++++++++--- src/config.js | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index f0e7b85..95d896c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -62932,14 +62932,19 @@ const github = __webpack_require__(95438); class Config { constructor() { + let label_list = JSON.parse(core.getInput('labels')); + let mode_option = core.getInput('mode') + if (mode_option === 'start'){ + label_list.push(this.generateUniqueLabel()) + } this.input = { - mode: core.getInput('mode'), + mode: mode_option, githubToken: core.getInput('github-token'), ec2ImageId: core.getInput('ec2-image-id'), ec2InstanceType: core.getInput('ec2-instance-type'), subnetId: core.getInput('subnet-id'), securityGroupId: core.getInput('security-group-id'), - labels: core.getInput('labels'), + labels: label_list, ec2InstanceIds: core.getInput('ec2-instance-ids'), iamRoleName: core.getInput('iam-role-name'), runnerHomeDir: core.getInput('runner-home-dir'), @@ -62990,7 +62995,7 @@ class Config { return Math.random().toString(36).substr(2, 5); } getLabels() { - return JSON.parse(this.input.labels) + return this.input.labels } getEc2InstanceIds(){ return JSON.parse(this.input.ec2InstanceIds) diff --git a/src/config.js b/src/config.js index 9fdcf0b..3f03a54 100644 --- a/src/config.js +++ b/src/config.js @@ -3,14 +3,19 @@ const github = require('@actions/github'); class Config { constructor() { + let label_list = JSON.parse(core.getInput('labels')); + let mode_option = core.getInput('mode') + if (mode_option === 'start'){ + label_list.push(this.generateUniqueLabel()) + } this.input = { - mode: core.getInput('mode'), + mode: mode_option, githubToken: core.getInput('github-token'), ec2ImageId: core.getInput('ec2-image-id'), ec2InstanceType: core.getInput('ec2-instance-type'), subnetId: core.getInput('subnet-id'), securityGroupId: core.getInput('security-group-id'), - labels: core.getInput('labels'), + labels: label_list, ec2InstanceIds: core.getInput('ec2-instance-ids'), iamRoleName: core.getInput('iam-role-name'), runnerHomeDir: core.getInput('runner-home-dir'), @@ -61,7 +66,7 @@ class Config { return Math.random().toString(36).substr(2, 5); } getLabels() { - return JSON.parse(this.input.labels) + return this.input.labels } getEc2InstanceIds(){ return JSON.parse(this.input.ec2InstanceIds)