File tree 3 files changed +17
-16
lines changed
3 files changed +17
-16
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ class ActionConfig {
52
52
this.ec2InstanceType = core.getInput("ec2_instance_type");
53
53
this.ec2AmiId = core.getInput("ec2_ami_id");
54
54
this.ec2InstanceIamRole = core.getInput("ec2_instance_iam_role");
55
- this.ec2InstanceTags = JSON.parse( core.getInput("ec2_instance_tags") );
55
+ this.ec2InstanceTags = core.getInput("ec2_instance_tags");
56
56
this.ec2InstanceTtl = core.getInput("ec2_instance_ttl");
57
57
this.ec2SubnetId = core.getInput("ec2_subnet_id");
58
58
this.ec2SecurityGroupId = core.getInput("ec2_security_group_id");
@@ -141,6 +141,11 @@ class Ec2Instance {
141
141
});
142
142
}
143
143
getTags() {
144
+ // Parse custom tags
145
+ let customTags = [];
146
+ if (this.config.ec2InstanceTags) {
147
+ customTags = JSON.parse(this.config.ec2InstanceTags);
148
+ }
144
149
return [
145
150
{
146
151
Key: "Name",
@@ -161,13 +166,8 @@ class Ec2Instance {
161
166
{
162
167
Key: "github_repo",
163
168
Value: this.config.githubRepo,
164
- }
165
- /*
166
- {
167
- Key: "expiration",
168
- Value: "some time goes here"
169
- },
170
- */
169
+ },
170
+ ...customTags
171
171
];
172
172
}
173
173
getCrossAccountCredentials() {
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export class ActionConfig implements ConfigInterface {
70
70
this . ec2InstanceType = core . getInput ( "ec2_instance_type" ) ;
71
71
this . ec2AmiId = core . getInput ( "ec2_ami_id" ) ;
72
72
this . ec2InstanceIamRole = core . getInput ( "ec2_instance_iam_role" ) ;
73
- this . ec2InstanceTags = JSON . parse ( core . getInput ( "ec2_instance_tags" ) ) ;
73
+ this . ec2InstanceTags = core . getInput ( "ec2_instance_tags" ) ;
74
74
this . ec2InstanceTtl = core . getInput ( "ec2_instance_ttl" ) ;
75
75
this . ec2SubnetId = core . getInput ( "ec2_subnet_id" ) ;
76
76
this . ec2SecurityGroupId = core . getInput ( "ec2_security_group_id" ) ;
Original file line number Diff line number Diff line change @@ -55,6 +55,12 @@ export class Ec2Instance {
55
55
}
56
56
57
57
getTags ( ) {
58
+ // Parse custom tags
59
+ let customTags = [ ]
60
+ if ( this . config . ec2InstanceTags ) {
61
+ customTags = JSON . parse ( this . config . ec2InstanceTags ) ;
62
+ }
63
+
58
64
return [
59
65
{
60
66
Key : "Name" ,
@@ -75,13 +81,8 @@ export class Ec2Instance {
75
81
{
76
82
Key : "github_repo" ,
77
83
Value : this . config . githubRepo ,
78
- }
79
- /*
80
- {
81
- Key: "expiration",
82
- Value: "some time goes here"
83
- },
84
- */
84
+ } ,
85
+ ...customTags
85
86
] ;
86
87
}
87
88
You can’t perform that action at this time.
0 commit comments