Skip to content

Commit e0bc618

Browse files
committed
Build fix
1 parent e10b4f0 commit e0bc618

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Will pass the following command to the container on the AWS ECS Fargate task:
104104
| task-wait-until-stopped | Whether to wait for the task to stop before finishing the action. If set to false, the action will finish immediately after the task reaches the `RUNNING` state (fire and forget). | `false` | true |
105105
| task-start-max-wait-time | How long to wait for the task to start (i.e. reach the `RUNNING` state) in seconds. If the task does not start within this time, the pipeline will fail. | `false` | 120 |
106106
| task-stopped-max-wait-time | How long to wait for the task to stop (i.e. reach the `STOPPED` state) in seconds. The task will not be canceled after this time, the pipeline will just be marked as failed. | `false` | 300 |
107+
| task-check-state-delay | How long to wait between each AWS API call to check the current state of the task in seconds. This is useful to avoid running into AWS rate limits. **However**, setting this too high might cause the Action to miss the time-window your task is in the "RUNNING" state (if you task is very short lived) and can cause the action to fail. | `false` | 6 |
107108
<!-- action-docs-inputs -->
108109

109110
<!-- action-docs-outputs -->

action.yml

+8
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ inputs:
8181
required: false
8282
default: 300
8383

84+
task-check-state-delay:
85+
description: >-
86+
How long to wait between each AWS API call to check the current state of the task in seconds. This is useful to
87+
avoid running into AWS rate limits. **However**, setting this too high might cause the Action to miss the time-window
88+
your task is in the "RUNNING" state (if you task is very short lived) and can cause the action to fail.
89+
required: false
90+
default: 6
91+
8492
outputs:
8593
task-arn:
8694
description: 'The full ARN for the task that was ran.'

dist/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -73927,6 +73927,7 @@ const main = async () => {
7392773927
const taskWaitUntilStopped = core.getBooleanInput('task-wait-until-stopped', {required: false});
7392873928
const taskStartMaxWaitTime = parseInt(core.getInput('task-start-max-wait-time', {required: false}));
7392973929
const taskStoppedMaxWaitTime = parseInt(core.getInput('task-stopped-max-wait-time', {required: false}));
73930+
const taskCheckStateDelay = parseInt(core.getInput('task-check-state-delay', {required: false}));
7393073931

7393173932
// Build Task parameters
7393273933
const taskRequestParams = {
@@ -74008,6 +74009,8 @@ const main = async () => {
7400874009
await waitUntilTasksRunning({
7400974010
client: ecs,
7401074011
maxWaitTime: taskStartMaxWaitTime,
74012+
maxDelay: taskCheckStateDelay,
74013+
minDelay: taskCheckStateDelay,
7401174014
}, {cluster, tasks: [taskArn]});
7401274015
} catch (error) {
7401374016
core.setFailed(`Task did not start successfully. Error: ${error.name}. State: ${error.state}.`);
@@ -74079,6 +74082,8 @@ const main = async () => {
7407974082
await waitUntilTasksStopped({
7408074083
client: ecs,
7408174084
maxWaitTime: taskStoppedMaxWaitTime,
74085+
maxDelay: taskCheckStateDelay,
74086+
minDelay: taskCheckStateDelay,
7408274087
}, {
7408374088
cluster,
7408474089
tasks: [taskArn],

index.js

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const main = async () => {
2929
const taskWaitUntilStopped = core.getBooleanInput('task-wait-until-stopped', {required: false});
3030
const taskStartMaxWaitTime = parseInt(core.getInput('task-start-max-wait-time', {required: false}));
3131
const taskStoppedMaxWaitTime = parseInt(core.getInput('task-stopped-max-wait-time', {required: false}));
32+
const taskCheckStateDelay = parseInt(core.getInput('task-check-state-delay', {required: false}));
3233

3334
// Build Task parameters
3435
const taskRequestParams = {
@@ -110,6 +111,8 @@ const main = async () => {
110111
await waitUntilTasksRunning({
111112
client: ecs,
112113
maxWaitTime: taskStartMaxWaitTime,
114+
maxDelay: taskCheckStateDelay,
115+
minDelay: taskCheckStateDelay,
113116
}, {cluster, tasks: [taskArn]});
114117
} catch (error) {
115118
core.setFailed(`Task did not start successfully. Error: ${error.name}. State: ${error.state}.`);
@@ -181,6 +184,8 @@ const main = async () => {
181184
await waitUntilTasksStopped({
182185
client: ecs,
183186
maxWaitTime: taskStoppedMaxWaitTime,
187+
maxDelay: taskCheckStateDelay,
188+
minDelay: taskCheckStateDelay,
184189
}, {
185190
cluster,
186191
tasks: [taskArn],

0 commit comments

Comments
 (0)