mirror of
https://github.com/nick-fields/retry.git
synced 2026-02-09 22:58:02 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e88a9994b0 | ||
|
|
5f63400863 | ||
|
|
c0687a0dcd | ||
|
|
102f21a736 | ||
|
|
752366eac8 | ||
|
|
a3da592761 | ||
|
|
7c5cca7536 | ||
|
|
f227091f2e | ||
|
|
6183d5c3dd | ||
|
|
71062288b7 | ||
|
|
afe1ef9058 | ||
|
|
e53cf64f16 |
39
.github/workflows/ci_cd.yml
vendored
39
.github/workflows/ci_cd.yml
vendored
@@ -1,8 +1,7 @@
|
||||
name: CI/CD
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
# runs on branch pushes only
|
||||
ci:
|
||||
@@ -79,6 +78,42 @@ jobs:
|
||||
command: node -e "process.exit(1)"
|
||||
on_retry_command: node -e "console.log('this is a retry command')"
|
||||
|
||||
- name: retry_on_exit_code (with expected error code)
|
||||
id: retry_on_exit_code_expected
|
||||
uses: ./
|
||||
continue-on-error: true
|
||||
with:
|
||||
timeout_minutes: 1
|
||||
retry_on_exit_code: 2
|
||||
max_attempts: 3
|
||||
command: node -e "process.exit(2)"
|
||||
- uses: nick-invision/assert-action@v1
|
||||
with:
|
||||
expected: failure
|
||||
actual: ${{ steps.retry_on_exit_code_expected.outcome }}
|
||||
- uses: nick-invision/assert-action@v1
|
||||
with:
|
||||
expected: 3
|
||||
actual: ${{ steps.retry_on_exit_code_expected.outputs.total_attempts }}
|
||||
|
||||
- name: retry_on_exit_code (with unexpected error code)
|
||||
id: retry_on_exit_code_unexpected
|
||||
uses: ./
|
||||
continue-on-error: true
|
||||
with:
|
||||
timeout_minutes: 1
|
||||
retry_on_exit_code: 2
|
||||
max_attempts: 3
|
||||
command: node -e "process.exit(1)"
|
||||
- uses: nick-invision/assert-action@v1
|
||||
with:
|
||||
expected: failure
|
||||
actual: ${{ steps.retry_on_exit_code_unexpected.outcome }}
|
||||
- uses: nick-invision/assert-action@v1
|
||||
with:
|
||||
expected: 1
|
||||
actual: ${{ steps.retry_on_exit_code_unexpected.outputs.total_attempts }}
|
||||
|
||||
- name: on-retry-cmd (on-retry fails)
|
||||
id: on-retry-cmd-fails
|
||||
uses: ./
|
||||
|
||||
44
README.md
44
README.md
@@ -2,6 +2,10 @@
|
||||
|
||||
Retries an Action step on failure or timeout. This is currently intended to replace the `run` step for moody commands.
|
||||
|
||||
**NOTE:** Ownership of this project was transferred to my personal account `nick-fields` from my work account `nick-invision`. Details [here](#Ownership)
|
||||
|
||||
---
|
||||
|
||||
## Inputs
|
||||
|
||||
### `timeout_minutes`
|
||||
@@ -52,6 +56,10 @@ Retries an Action step on failure or timeout. This is currently intended to repl
|
||||
|
||||
**Optional** Exit successfully even if an error occurs. Same as native continue-on-error behavior, but for use in composite actions. Defaults to `false`
|
||||
|
||||
### `retry_on_exit_code`
|
||||
|
||||
**Optional** Specific exit code to retry on. This will only retry for the given error code and fail immediately other error codes.
|
||||
|
||||
## Outputs
|
||||
|
||||
### `total_attempts`
|
||||
@@ -71,7 +79,7 @@ The final error returned by the command
|
||||
### Shell
|
||||
|
||||
```yaml
|
||||
uses: nick-invision/retry@v2
|
||||
uses: nick-fields/retry@v2
|
||||
with:
|
||||
timeout_minutes: 10
|
||||
max_attempts: 3
|
||||
@@ -82,7 +90,7 @@ with:
|
||||
### Timeout in minutes
|
||||
|
||||
```yaml
|
||||
uses: nick-invision/retry@v2
|
||||
uses: nick-fields/retry@v2
|
||||
with:
|
||||
timeout_minutes: 10
|
||||
max_attempts: 3
|
||||
@@ -92,7 +100,7 @@ with:
|
||||
### Timeout in seconds
|
||||
|
||||
```yaml
|
||||
uses: nick-invision/retry@v2
|
||||
uses: nick-fields/retry@v2
|
||||
with:
|
||||
timeout_seconds: 15
|
||||
max_attempts: 3
|
||||
@@ -102,7 +110,7 @@ with:
|
||||
### Only retry after timeout
|
||||
|
||||
```yaml
|
||||
uses: nick-invision/retry@v2
|
||||
uses: nick-fields/retry@v2
|
||||
with:
|
||||
timeout_seconds: 15
|
||||
max_attempts: 3
|
||||
@@ -113,7 +121,7 @@ with:
|
||||
### Only retry after error
|
||||
|
||||
```yaml
|
||||
uses: nick-invision/retry@v2
|
||||
uses: nick-fields/retry@v2
|
||||
with:
|
||||
timeout_seconds: 15
|
||||
max_attempts: 3
|
||||
@@ -124,7 +132,7 @@ with:
|
||||
### Retry using continue_on_error input (in composite action) but allow failure and do something with output
|
||||
|
||||
```yaml
|
||||
- uses: nick-invision/retry@v2
|
||||
- uses: nick-fields/retry@v2
|
||||
id: retry
|
||||
with:
|
||||
timeout_seconds: 15
|
||||
@@ -132,12 +140,12 @@ with:
|
||||
continue_on_error: true
|
||||
command: node -e 'process.exit(99);'
|
||||
- name: Assert that step succeeded (despite failing command)
|
||||
uses: nick-invision/assert-action@v1
|
||||
uses: nick-fields/assert-action@v1
|
||||
with:
|
||||
expected: success
|
||||
actual: ${{ steps.retry.outcome }}
|
||||
- name: Assert that action exited with expected exit code
|
||||
uses: nick-invision/assert-action@v1
|
||||
uses: nick-fields/assert-action@v1
|
||||
with:
|
||||
expected: 99
|
||||
actual: ${{ steps.retry.outputs.exit_code }}
|
||||
@@ -146,7 +154,7 @@ with:
|
||||
### Retry using continue-on-error built-in command (in workflow action) but allow failure and do something with output
|
||||
|
||||
```yaml
|
||||
- uses: nick-invision/retry@v2
|
||||
- uses: nick-fields/retry@v2
|
||||
id: retry
|
||||
# see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error
|
||||
continue-on-error: true
|
||||
@@ -156,17 +164,17 @@ with:
|
||||
retry_on: error
|
||||
command: node -e 'process.exit(99);'
|
||||
- name: Assert that action failed
|
||||
uses: nick-invision/assert-action@v1
|
||||
uses: nick-fields/assert-action@v1
|
||||
with:
|
||||
expected: failure
|
||||
actual: ${{ steps.retry.outcome }}
|
||||
- name: Assert that action exited with expected exit code
|
||||
uses: nick-invision/assert-action@v1
|
||||
uses: nick-fields/assert-action@v1
|
||||
with:
|
||||
expected: 99
|
||||
actual: ${{ steps.retry.outputs.exit_code }}
|
||||
- name: Assert that action made expected number of attempts
|
||||
uses: nick-invision/assert-action@v1
|
||||
uses: nick-fields/assert-action@v1
|
||||
with:
|
||||
expected: 3
|
||||
actual: ${{ steps.retry.outputs.total_attempts }}
|
||||
@@ -175,7 +183,7 @@ with:
|
||||
### Run script after failure but before retry
|
||||
|
||||
```yaml
|
||||
uses: nick-invision/retry@v2
|
||||
uses: nick-fields/retry@v2
|
||||
with:
|
||||
timeout_seconds: 15
|
||||
max_attempts: 3
|
||||
@@ -186,7 +194,7 @@ with:
|
||||
### Run different command after first failure
|
||||
|
||||
```yaml
|
||||
uses: nick-invision/retry@v2
|
||||
uses: nick-fields/retry@v2
|
||||
with:
|
||||
timeout_seconds: 15
|
||||
max_attempts: 3
|
||||
@@ -224,3 +232,11 @@ with:
|
||||
## Requirements
|
||||
|
||||
NodeJS is required for this action to run. This runs without issue on all GitHub hosted runners but if you are running into issues with this on self hosted runners ensure NodeJS is installed.
|
||||
|
||||
---
|
||||
|
||||
## **Ownership**
|
||||
|
||||
As of 2022/02/15 ownership of this project has been transferred to my personal account `nick-fields` from my work account `nick-invision` due to me leaving InVision. I am the author and have been the primary maintainer since day one and will continue to maintain this as needed.
|
||||
|
||||
Existing workflow references to `nick-invision/retry@<whatever>` no longer work and must be updated to `nick-fields/retry@<whatever>`.
|
||||
|
||||
@@ -39,6 +39,9 @@ inputs:
|
||||
new_command_on_retry:
|
||||
description: Command to run if the first attempt fails. This command will be called on all subsequent attempts.
|
||||
required: false
|
||||
retry_on_exit_code:
|
||||
description: Specific exit code to retry on. This will only retry for the given error code and fail immediately other error codes.
|
||||
required: false
|
||||
outputs:
|
||||
total_attempts:
|
||||
description: The final number of attempts made
|
||||
|
||||
24
dist/index.js
vendored
24
dist/index.js
vendored
@@ -289,6 +289,7 @@ var WARNING_ON_RETRY = core_1.getInput('warning_on_retry').toLowerCase() === 'tr
|
||||
var ON_RETRY_COMMAND = core_1.getInput('on_retry_command');
|
||||
var CONTINUE_ON_ERROR = getInputBoolean('continue_on_error');
|
||||
var NEW_COMMAND_ON_RETRY = core_1.getInput('new_command_on_retry');
|
||||
var RETRY_ON_EXIT_CODE = getInputNumber('retry_on_exit_code', false);
|
||||
var OS = process.platform;
|
||||
var OUTPUT_TOTAL_ATTEMPTS_KEY = 'total_attempts';
|
||||
var OUTPUT_EXIT_CODE_KEY = 'exit_code';
|
||||
@@ -479,17 +480,17 @@ function runAction() {
|
||||
attempt = 1;
|
||||
_a.label = 2;
|
||||
case 2:
|
||||
if (!(attempt <= MAX_ATTEMPTS)) return [3 /*break*/, 12];
|
||||
if (!(attempt <= MAX_ATTEMPTS)) return [3 /*break*/, 13];
|
||||
_a.label = 3;
|
||||
case 3:
|
||||
_a.trys.push([3, 5, , 11]);
|
||||
_a.trys.push([3, 5, , 12]);
|
||||
// just keep overwriting attempts output
|
||||
core_1.setOutput(OUTPUT_TOTAL_ATTEMPTS_KEY, attempt);
|
||||
return [4 /*yield*/, runCmd(attempt)];
|
||||
case 4:
|
||||
_a.sent();
|
||||
core_1.info("Command completed after " + attempt + " attempt(s).");
|
||||
return [3 /*break*/, 12];
|
||||
return [3 /*break*/, 13];
|
||||
case 5:
|
||||
error_2 = _a.sent();
|
||||
if (!(attempt === MAX_ATTEMPTS)) return [3 /*break*/, 6];
|
||||
@@ -499,11 +500,14 @@ function runAction() {
|
||||
// error: timeout
|
||||
throw error_2;
|
||||
case 7:
|
||||
if (!(exit > 0 && RETRY_ON === 'timeout')) return [3 /*break*/, 8];
|
||||
if (!(RETRY_ON_EXIT_CODE && RETRY_ON_EXIT_CODE !== exit)) return [3 /*break*/, 8];
|
||||
throw error_2;
|
||||
case 8:
|
||||
if (!(exit > 0 && RETRY_ON === 'timeout')) return [3 /*break*/, 9];
|
||||
// error: error
|
||||
throw error_2;
|
||||
case 8: return [4 /*yield*/, runRetryCmd()];
|
||||
case 9:
|
||||
case 9: return [4 /*yield*/, runRetryCmd()];
|
||||
case 10:
|
||||
_a.sent();
|
||||
if (WARNING_ON_RETRY) {
|
||||
core_1.warning("Attempt " + attempt + " failed. Reason: " + error_2.message);
|
||||
@@ -511,12 +515,12 @@ function runAction() {
|
||||
else {
|
||||
core_1.info("Attempt " + attempt + " failed. Reason: " + error_2.message);
|
||||
}
|
||||
_a.label = 10;
|
||||
case 10: return [3 /*break*/, 11];
|
||||
case 11:
|
||||
_a.label = 11;
|
||||
case 11: return [3 /*break*/, 12];
|
||||
case 12:
|
||||
attempt++;
|
||||
return [3 /*break*/, 2];
|
||||
case 12: return [2 /*return*/];
|
||||
case 13: return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
180
package-lock.json
generated
180
package-lock.json
generated
@@ -1175,6 +1175,12 @@
|
||||
"supports-color": "^5.3.0"
|
||||
}
|
||||
},
|
||||
"chownr": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
|
||||
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
|
||||
"dev": true
|
||||
},
|
||||
"ci-info": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz",
|
||||
@@ -1992,6 +1998,15 @@
|
||||
"universalify": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"fs-minipass": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz",
|
||||
"integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minipass": "^2.6.0"
|
||||
}
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
@@ -3064,9 +3079,9 @@
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
||||
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
|
||||
"dev": true
|
||||
},
|
||||
"minimist-options": {
|
||||
@@ -3079,6 +3094,50 @@
|
||||
"is-plain-obj": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"minipass": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz",
|
||||
"integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"yallist": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
|
||||
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"minizlib": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz",
|
||||
"integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minipass": "^2.9.0"
|
||||
}
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.6",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
|
||||
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "^1.2.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"minimist": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
||||
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"modify-values": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz",
|
||||
@@ -3113,10 +3172,13 @@
|
||||
}
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
||||
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
|
||||
"dev": true
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"normalize-package-data": {
|
||||
"version": "2.5.0",
|
||||
@@ -4195,7 +4257,6 @@
|
||||
"fs-minipass": {
|
||||
"version": "1.2.7",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minipass": "^2.6.0"
|
||||
},
|
||||
@@ -4203,7 +4264,6 @@
|
||||
"minipass": {
|
||||
"version": "2.9.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.0"
|
||||
@@ -5075,15 +5135,9 @@
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.5",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"minizlib": {
|
||||
"version": "1.3.3",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minipass": "^2.9.0"
|
||||
},
|
||||
@@ -5091,7 +5145,6 @@
|
||||
"minipass": {
|
||||
"version": "2.9.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.0"
|
||||
@@ -5122,13 +5175,6 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "^1.2.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"minimist": {
|
||||
"version": "1.2.5",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"move-concurrently": {
|
||||
@@ -5854,8 +5900,7 @@
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"bundled": true
|
||||
},
|
||||
"safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
@@ -6174,31 +6219,6 @@
|
||||
"has-flag": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"tar": {
|
||||
"version": "4.4.13",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chownr": "^1.1.1",
|
||||
"fs-minipass": "^1.2.5",
|
||||
"minipass": "^2.8.6",
|
||||
"minizlib": "^1.2.1",
|
||||
"mkdirp": "^0.5.0",
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"minipass": {
|
||||
"version": "2.9.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"term-size": {
|
||||
"version": "1.2.0",
|
||||
"bundled": true,
|
||||
@@ -6531,8 +6551,7 @@
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.0.3",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"bundled": true
|
||||
},
|
||||
"yargs": {
|
||||
"version": "14.2.3",
|
||||
@@ -7503,6 +7522,35 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"tar": {
|
||||
"version": "4.4.19",
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz",
|
||||
"integrity": "sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chownr": "^1.1.4",
|
||||
"fs-minipass": "^1.2.7",
|
||||
"minipass": "^2.9.0",
|
||||
"minizlib": "^1.3.3",
|
||||
"mkdirp": "^0.5.5",
|
||||
"safe-buffer": "^5.2.1",
|
||||
"yallist": "^3.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
||||
"dev": true
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
|
||||
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"temp-dir": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz",
|
||||
@@ -7560,6 +7608,12 @@
|
||||
"is-number": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=",
|
||||
"dev": true
|
||||
},
|
||||
"traverse": {
|
||||
"version": "0.6.6",
|
||||
"resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz",
|
||||
@@ -7578,9 +7632,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"trim-off-newlines": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz",
|
||||
"integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=",
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.3.tgz",
|
||||
"integrity": "sha512-kh6Tu6GbeSNMGfrrZh6Bb/4ZEHV1QlB4xNDBeog8Y9/QwFlKTRyWvY3Fs9tRDAMZliVUwieMgEdIeL/FtqjkJg==",
|
||||
"dev": true
|
||||
},
|
||||
"ts-node": {
|
||||
@@ -7658,6 +7712,22 @@
|
||||
"spdx-expression-parse": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=",
|
||||
"dev": true
|
||||
},
|
||||
"whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
|
||||
@@ -18,6 +18,7 @@ const WARNING_ON_RETRY = getInput('warning_on_retry').toLowerCase() === 'true';
|
||||
const ON_RETRY_COMMAND = getInput('on_retry_command');
|
||||
const CONTINUE_ON_ERROR = getInputBoolean('continue_on_error');
|
||||
const NEW_COMMAND_ON_RETRY = getInput('new_command_on_retry');
|
||||
const RETRY_ON_EXIT_CODE = getInputNumber('retry_on_exit_code', false);
|
||||
|
||||
const OS = process.platform;
|
||||
const OUTPUT_TOTAL_ATTEMPTS_KEY = 'total_attempts';
|
||||
@@ -187,6 +188,8 @@ async function runAction() {
|
||||
} else if (!done && RETRY_ON === 'error') {
|
||||
// error: timeout
|
||||
throw error;
|
||||
} else if (RETRY_ON_EXIT_CODE && RETRY_ON_EXIT_CODE !== exit){
|
||||
throw error;
|
||||
} else if (exit > 0 && RETRY_ON === 'timeout') {
|
||||
// error: error
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user