Compare commits

..

33 Commits

Author SHA1 Message Date
Nick Fields
e88a9994b0 Merge pull request #60 from nick-fields/dependabot/npm_and_yarn/trim-off-newlines-1.0.3
build(deps): bump trim-off-newlines from 1.0.1 to 1.0.3
2022-04-25 22:23:51 -04:00
Nick Fields
5f63400863 Merge pull request #61 from nick-fields/dependabot/npm_and_yarn/tar-4.4.19
build(deps): bump tar from 4.4.13 to 4.4.19
2022-04-25 22:21:56 -04:00
Nick Fields
c0687a0dcd Merge pull request #59 from nick-fields/dependabot/npm_and_yarn/node-fetch-2.6.7
build(deps): bump node-fetch from 2.6.1 to 2.6.7
2022-04-25 22:21:05 -04:00
Nick Fields
102f21a736 Merge pull request #56 from nick-fields/dependabot/npm_and_yarn/minimist-1.2.6
build(deps): bump minimist from 1.2.5 to 1.2.6
2022-04-25 22:19:43 -04:00
dependabot[bot]
752366eac8 build(deps): bump tar from 4.4.13 to 4.4.19
Bumps [tar](https://github.com/npm/node-tar) from 4.4.13 to 4.4.19.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v4.4.13...v4.4.19)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-26 02:11:36 +00:00
dependabot[bot]
a3da592761 build(deps): bump trim-off-newlines from 1.0.1 to 1.0.3
Bumps [trim-off-newlines](https://github.com/stevemao/trim-off-newlines) from 1.0.1 to 1.0.3.
- [Release notes](https://github.com/stevemao/trim-off-newlines/releases)
- [Commits](https://github.com/stevemao/trim-off-newlines/compare/v1.0.1...v1.0.3)

---
updated-dependencies:
- dependency-name: trim-off-newlines
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-26 02:11:35 +00:00
dependabot[bot]
7c5cca7536 build(deps): bump node-fetch from 2.6.1 to 2.6.7
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.1...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-26 02:11:35 +00:00
Nick Fields
f227091f2e feat: retry only on specific exit code (#58)
* feat: retry only on specific exit code

* Run ci_cd on all push events

* dedupe step IDs

* add assertions for retry_on_exit_code tests

* minor: implemented suggested fix from @andersfischernielsen

* docs: update readme to reflect new retry_on_exit_code input

Co-authored-by: Anders Fischer-Nielsen <andersfischern@me.com>
2022-04-25 22:10:55 -04:00
dependabot[bot]
6183d5c3dd build(deps): bump minimist from 1.2.5 to 1.2.6
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-26 04:15:35 +00:00
Nick Fields
71062288b7 Merge pull request #55 from jameswald/patch-1
Github is no longer forwarding nick-invision/retry
2022-02-16 13:59:13 -05:00
James Wald
afe1ef9058 Github is no longer forwarding nick-invision/retry 2022-02-16 10:55:42 -08:00
Nick Fields
e53cf64f16 Update ownership in README.md 2022-02-15 21:15:12 -05:00
Nick Fields
7f8f3d9f0f Merge pull request #50 from asnewman/new-command-on-retry-feature
Add new_command_on_retry
2021-12-09 20:05:34 -05:00
Nick Fields
bf1736e338 minor: regenerate dist 2021-12-09 20:02:53 -05:00
asnewman
f7cf641580 Add new_command_on_retry 2021-12-08 20:15:21 -08:00
Nick Fields
002ef572db Merge pull request #49 from lwhiteley/patch-1
fix: incorrect option for continue_on_error
2021-10-23 21:32:55 -04:00
Layton Whiteley
e80198a9da fix: incorrect option for continue_on_error
continue_on_error example was incorrect and if used would generate a warning.

change `continue-on-error` to `continue_on_error`
2021-10-20 16:50:07 +02:00
Nick Fields
c77dc43532 Merge pull request #48 from nick-invision/nrf/continue-on-error
Add continue_on_error action input
2021-10-06 20:02:05 -04:00
Nick Fields
0019811846 docs: update README with new input and usage 2021-09-23 22:36:47 -04:00
Nick Fields
a63662d5a7 patch: refresh from master 2021-09-23 22:29:08 -04:00
Nick Fields
67e1bdfd8d minor: add continue_on_error input option 2021-09-23 22:26:06 -04:00
Nick Fields
45ba062d35 Merge pull request #42 from nick-invision/nrf/add-multiline-example
Add multi-line example, consolidate dependabot maintenance bumps
2021-06-10 18:27:14 -04:00
Nick Fields
0470ad1628 patch: pull in open dependabot bumps 2021-06-10 18:08:08 -04:00
Nick Fields
2750220347 fix test 2021-06-10 17:55:53 -04:00
Nick Fields
b00fd808da add multi line example and test 2021-06-10 17:44:58 -04:00
Nick Fields
bebba89192 Merge pull request #40 from nick-invision/dependabot/npm_and_yarn/normalize-url-5.3.1
build(deps): bump normalize-url from 5.3.0 to 5.3.1
2021-06-08 21:12:49 -04:00
dependabot[bot]
52b3fdbcaa build(deps): bump normalize-url from 5.3.0 to 5.3.1
Bumps [normalize-url](https://github.com/sindresorhus/normalize-url) from 5.3.0 to 5.3.1.
- [Release notes](https://github.com/sindresorhus/normalize-url/releases)
- [Commits](https://github.com/sindresorhus/normalize-url/commits)

---
updated-dependencies:
- dependency-name: normalize-url
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-09 00:51:44 +00:00
dependabot[bot]
f3f0bb1a3c build(deps): bump hosted-git-info from 2.8.5 to 2.8.9 (#39)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.5 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.5...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 10:32:50 -04:00
Nick Fields
7c68161adf Add on_retry_command input to optionally run cmd before a retry (#33)
* minor: add on_retry_command input to optionally run cmd before a retry

* test: add test for on-retry-command failure
2021-01-04 21:32:32 -05:00
Nick Fields
025c480d85 Merge pull request #32 from nick-invision/dependabot/npm_and_yarn/lodash-4.17.20
build(deps): bump lodash from 4.17.15 to 4.17.20
2021-01-03 21:35:32 -05:00
Nick Fields
3073a9f1e1 Merge pull request #29 from nick-invision/dependabot/npm_and_yarn/ini-1.3.8
build(deps): bump ini from 1.3.5 to 1.3.8
2021-01-03 21:28:10 -05:00
dependabot[bot]
9e6dab8302 build(deps): bump lodash from 4.17.15 to 4.17.20
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.20.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.20)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-04 02:27:53 +00:00
dependabot[bot]
7463808b4e build(deps): bump ini from 1.3.5 to 1.3.8
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-12 07:53:24 +00:00
8 changed files with 668 additions and 211 deletions

View File

@@ -1,8 +1,7 @@
name: CI/CD name: CI/CD
on: on:
push: push:
branches:
- '**'
jobs: jobs:
# runs on branch pushes only # runs on branch pushes only
ci: ci:
@@ -60,6 +59,71 @@ jobs:
actual: ${{ steps.sad_path_wait_sec.outputs.exit_error }} actual: ${{ steps.sad_path_wait_sec.outputs.exit_error }}
comparison: contains comparison: contains
- name: new-command-on-retry
id: new-command-on-retry
uses: ./
with:
timeout_minutes: 1
max_attempts: 3
command: node -e "process.exit(1)"
new_command_on_retry: node -e "console.log('this is the new command on retry')"
- name: on-retry-cmd
id: on-retry-cmd
uses: ./
continue-on-error: true
with:
timeout_minutes: 1
max_attempts: 3
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: ./
continue-on-error: true
with:
timeout_minutes: 1
max_attempts: 3
command: node -e "process.exit(1)"
on_retry_command: node -e "throw new Error('This is an on-retry command error')"
- name: sad-path (error) - name: sad-path (error)
id: sad_path_error id: sad_path_error
uses: ./ uses: ./
@@ -77,6 +141,41 @@ jobs:
expected: failure expected: failure
actual: ${{ steps.sad_path_error.outcome }} actual: ${{ steps.sad_path_error.outcome }}
- name: happy-path (continue_on_error)
id: happy_path_continue_on_error
uses: ./
with:
command: node -e "process.exit(0)"
timeout_minutes: 1
continue_on_error: true
- name: sad-path (continue_on_error)
id: sad_path_continue_on_error
uses: ./
with:
command: node -e "process.exit(33)"
timeout_minutes: 1
continue_on_error: true
- name: Verify continue_on_error returns correct exit code on success
uses: nick-invision/assert-action@v1
with:
expected: 0
actual: ${{ steps.happy_path_continue_on_error.outputs.exit_code }}
- name: Verify continue_on_error exits with correct outcome on success
uses: nick-invision/assert-action@v1
with:
expected: success
actual: ${{ steps.happy_path_continue_on_error.outcome }}
- name: Verify continue_on_error returns correct exit code on error
uses: nick-invision/assert-action@v1
with:
expected: 33
actual: ${{ steps.sad_path_continue_on_error.outputs.exit_code }}
- name: Verify continue_on_error exits with successful outcome when an error occurs
uses: nick-invision/assert-action@v1
with:
expected: success
actual: ${{ steps.sad_path_continue_on_error.outcome }}
- name: retry_on (timeout) fails early if error encountered - name: retry_on (timeout) fails early if error encountered
id: retry_on_timeout_fail id: retry_on_timeout_fail
uses: ./ uses: ./
@@ -121,7 +220,6 @@ jobs:
expected: 2 expected: 2
actual: ${{ steps.retry_on_error.outputs.exit_code }} actual: ${{ steps.retry_on_error.outputs.exit_code }}
# timeout tests (takes longer to run so run last) # timeout tests (takes longer to run so run last)
- name: sad-path (timeout) - name: sad-path (timeout)
id: sad_path_timeout id: sad_path_timeout
@@ -205,7 +303,7 @@ jobs:
timeout_minutes: 1 timeout_minutes: 1
max_attempts: 2 max_attempts: 2
shell: cmd shell: cmd
command: "dir" command: 'dir'
- uses: nick-invision/assert-action@v1 - uses: nick-invision/assert-action@v1
with: with:
expected: 2 expected: 2
@@ -249,6 +347,23 @@ jobs:
max_attempts: 2 max_attempts: 2
shell: python shell: python
command: print('1', '2', '3') command: print('1', '2', '3')
- name: Multi-line multi-command Test
uses: ./
with:
timeout_minutes: 1
max_attempts: 2
command: |
Get-ComputerInfo
Get-Date
- name: Multi-line single-command Test
uses: ./
with:
timeout_minutes: 1
max_attempts: 2
shell: cmd
command: >-
echo "this is
a test"
# runs on push to master only # runs on push to master only
cd: cd:

View File

@@ -8,6 +8,7 @@ module.exports = {
{ type: 'minor', release: 'minor' }, { type: 'minor', release: 'minor' },
{ type: 'major', release: 'major' }, { type: 'major', release: 'major' },
{ type: 'patch', release: 'patch' }, { type: 'patch', release: 'patch' },
{ type: 'test', release: false },
{ scope: 'no-release', release: false }, { scope: 'no-release', release: false },
], ],
}, },

123
README.md
View File

@@ -2,6 +2,10 @@
Retries an Action step on failure or timeout. This is currently intended to replace the `run` step for moody commands. 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 ## Inputs
### `timeout_minutes` ### `timeout_minutes`
@@ -25,8 +29,8 @@ Retries an Action step on failure or timeout. This is currently intended to repl
**Optional** Number of seconds to wait before attempting the next retry. Defaults to `10` **Optional** Number of seconds to wait before attempting the next retry. Defaults to `10`
### `shell` ### `shell`
**Optional** Shell to use to execute `command`. Defaults to `powershell` on Windows, `bash` otherwise. Supports bash, python, pwsh, sh, cmd, and powershell per [docs](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell) **Optional** Shell to use to execute `command`. Defaults to `powershell` on Windows, `bash` otherwise. Supports bash, python, pwsh, sh, cmd, and powershell per [docs](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell)
### `polling_interval_seconds` ### `polling_interval_seconds`
@@ -40,6 +44,22 @@ Retries an Action step on failure or timeout. This is currently intended to repl
**Optional** Whether to output a warning on retry, or just output to info. Defaults to `true`. **Optional** Whether to output a warning on retry, or just output to info. Defaults to `true`.
### `on_retry_command`
**Optional** Command to run before a retry (such as a cleanup script). Any error thrown from retry command is caught and surfaced as a warning.
### `new_command_on_retry`
**Optional** Command to run if the first attempt fails. This command will be called on all subsequent attempts.
### `continue_on_error`
**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 ## Outputs
### `total_attempts` ### `total_attempts`
@@ -59,7 +79,7 @@ The final error returned by the command
### Shell ### Shell
```yaml ```yaml
uses: nick-invision/retry@v2 uses: nick-fields/retry@v2
with: with:
timeout_minutes: 10 timeout_minutes: 10
max_attempts: 3 max_attempts: 3
@@ -70,7 +90,7 @@ with:
### Timeout in minutes ### Timeout in minutes
```yaml ```yaml
uses: nick-invision/retry@v2 uses: nick-fields/retry@v2
with: with:
timeout_minutes: 10 timeout_minutes: 10
max_attempts: 3 max_attempts: 3
@@ -80,7 +100,7 @@ with:
### Timeout in seconds ### Timeout in seconds
```yaml ```yaml
uses: nick-invision/retry@v2 uses: nick-fields/retry@v2
with: with:
timeout_seconds: 15 timeout_seconds: 15
max_attempts: 3 max_attempts: 3
@@ -90,7 +110,7 @@ with:
### Only retry after timeout ### Only retry after timeout
```yaml ```yaml
uses: nick-invision/retry@v2 uses: nick-fields/retry@v2
with: with:
timeout_seconds: 15 timeout_seconds: 15
max_attempts: 3 max_attempts: 3
@@ -101,7 +121,7 @@ with:
### Only retry after error ### Only retry after error
```yaml ```yaml
uses: nick-invision/retry@v2 uses: nick-fields/retry@v2
with: with:
timeout_seconds: 15 timeout_seconds: 15
max_attempts: 3 max_attempts: 3
@@ -109,10 +129,32 @@ with:
command: npm run some-typically-fast-script command: npm run some-typically-fast-script
``` ```
### Retry but allow failure and do something with output ### Retry using continue_on_error input (in composite action) but allow failure and do something with output
```yaml ```yaml
- uses: nick-invision/retry@v2 - uses: nick-fields/retry@v2
id: retry
with:
timeout_seconds: 15
max_attempts: 3
continue_on_error: true
command: node -e 'process.exit(99);'
- name: Assert that step succeeded (despite failing command)
uses: nick-fields/assert-action@v1
with:
expected: success
actual: ${{ steps.retry.outcome }}
- name: Assert that action exited with expected exit code
uses: nick-fields/assert-action@v1
with:
expected: 99
actual: ${{ steps.retry.outputs.exit_code }}
```
### Retry using continue-on-error built-in command (in workflow action) but allow failure and do something with output
```yaml
- uses: nick-fields/retry@v2
id: retry id: retry
# see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error # 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 continue-on-error: true
@@ -122,22 +164,79 @@ with:
retry_on: error retry_on: error
command: node -e 'process.exit(99);' command: node -e 'process.exit(99);'
- name: Assert that action failed - name: Assert that action failed
uses: nick-invision/assert-action@v1 uses: nick-fields/assert-action@v1
with: with:
expected: failure expected: failure
actual: ${{ steps.retry.outcome }} actual: ${{ steps.retry.outcome }}
- name: Assert that action exited with expected exit code - name: Assert that action exited with expected exit code
uses: nick-invision/assert-action@v1 uses: nick-fields/assert-action@v1
with: with:
expected: 99 expected: 99
actual: ${{ steps.retry.outputs.exit_code }} actual: ${{ steps.retry.outputs.exit_code }}
- name: Assert that action made expected number of attempts - name: Assert that action made expected number of attempts
uses: nick-invision/assert-action@v1 uses: nick-fields/assert-action@v1
with: with:
expected: 3 expected: 3
actual: ${{ steps.retry.outputs.total_attempts }} actual: ${{ steps.retry.outputs.total_attempts }}
``` ```
### Run script after failure but before retry
```yaml
uses: nick-fields/retry@v2
with:
timeout_seconds: 15
max_attempts: 3
command: npm run some-flaky-script-that-outputs-something
on_retry_command: npm run cleanup-flaky-script-output
```
### Run different command after first failure
```yaml
uses: nick-fields/retry@v2
with:
timeout_seconds: 15
max_attempts: 3
command: npx jest
new_command_on_retry: npx jest --onlyFailures
```
### Run multi-line, multi-command script
```yaml
name: Multi-line multi-command Test
uses: ./
with:
timeout_minutes: 1
max_attempts: 2
command: |
Get-ComputerInfo
Get-Date
```
### Run multi-line, single-command script
```yaml
name: Multi-line single-command Test
uses: ./
with:
timeout_minutes: 1
max_attempts: 2
shell: cmd
command: >-
echo "this is
a test"
```
## Requirements ## 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. 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>`.

View File

@@ -30,6 +30,18 @@ inputs:
warning_on_retry: warning_on_retry:
description: Whether to output a warning on retry, or just output to info. Defaults to true description: Whether to output a warning on retry, or just output to info. Defaults to true
default: true default: true
on_retry_command:
description: Command to run before a retry (such as a cleanup script). Any error thrown from retry command is caught and surfaced as a warning.
required: false
continue_on_error:
description: Exits successfully even if an error occurs. Same as native continue-on-error behavior, but for use in composite actions. Default is false
default: false
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: outputs:
total_attempts: total_attempts:
description: The final number of attempts made description: The final number of attempts made
@@ -39,4 +51,4 @@ outputs:
description: The final error returned by the command description: The final error returned by the command
runs: runs:
using: 'node12' using: 'node12'
main: 'dist/index.js' main: 'dist/index.js'

260
dist/index.js vendored
View File

@@ -51,6 +51,7 @@ module.exports =
// We use any as a valid input type // We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.toCommandProperties = exports.toCommandValue = void 0;
/** /**
* Sanitizes an input into a string so it can be passed into issueCommand safely * Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string * @param input input to sanitize into a string
@@ -65,6 +66,25 @@ function toCommandValue(input) {
return JSON.stringify(input); return JSON.stringify(input);
} }
exports.toCommandValue = toCommandValue; exports.toCommandValue = toCommandValue;
/**
*
* @param annotationProperties
* @returns The command properties to send with the actual annotation command
* See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
*/
function toCommandProperties(annotationProperties) {
if (!Object.keys(annotationProperties).length) {
return {};
}
return {
title: annotationProperties.title,
line: annotationProperties.startLine,
endLine: annotationProperties.endLine,
col: annotationProperties.startColumn,
endColumn: annotationProperties.endColumn
};
}
exports.toCommandProperties = toCommandProperties;
//# sourceMappingURL=utils.js.map //# sourceMappingURL=utils.js.map
/***/ }), /***/ }),
@@ -82,14 +102,27 @@ module.exports = require("os");
"use strict"; "use strict";
// For internal use, subject to change. // For internal use, subject to change.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
result["default"] = mod; __setModuleDefault(result, mod);
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.issueCommand = void 0;
// We use any as a valid input type // We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
const fs = __importStar(__webpack_require__(747)); const fs = __importStar(__webpack_require__(747));
@@ -253,6 +286,10 @@ var SHELL = core_1.getInput('shell');
var POLLING_INTERVAL_SECONDS = getInputNumber('polling_interval_seconds', false) || 1; var POLLING_INTERVAL_SECONDS = getInputNumber('polling_interval_seconds', false) || 1;
var RETRY_ON = core_1.getInput('retry_on') || 'any'; var RETRY_ON = core_1.getInput('retry_on') || 'any';
var WARNING_ON_RETRY = core_1.getInput('warning_on_retry').toLowerCase() === 'true'; var WARNING_ON_RETRY = core_1.getInput('warning_on_retry').toLowerCase() === 'true';
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 OS = process.platform;
var OUTPUT_TOTAL_ATTEMPTS_KEY = 'total_attempts'; var OUTPUT_TOTAL_ATTEMPTS_KEY = 'total_attempts';
var OUTPUT_EXIT_CODE_KEY = 'exit_code'; var OUTPUT_EXIT_CODE_KEY = 'exit_code';
@@ -271,6 +308,13 @@ function getInputNumber(id, required) {
} }
return num; return num;
} }
function getInputBoolean(id) {
var input = core_1.getInput(id);
if (!['true', 'false'].includes(input.toLowerCase())) {
throw "Input " + id + " only accepts boolean values. Received " + input;
}
return input.toLowerCase() === 'true';
}
function retryWait() { function retryWait() {
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
var waitStart; var waitStart;
@@ -340,7 +384,33 @@ function getExecutable() {
} }
return executable; return executable;
} }
function runCmd() { function runRetryCmd() {
return __awaiter(this, void 0, void 0, function () {
var error_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
// if no retry script, just continue
if (!ON_RETRY_COMMAND) {
return [2 /*return*/];
}
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, child_process_1.execSync(ON_RETRY_COMMAND, { stdio: 'inherit' })];
case 2:
_a.sent();
return [3 /*break*/, 4];
case 3:
error_1 = _a.sent();
core_1.info("WARNING: Retry command threw the error " + error_1.message);
return [3 /*break*/, 4];
case 4: return [2 /*return*/];
}
});
});
}
function runCmd(attempt) {
var _a, _b; var _a, _b;
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
var end_time, executable, child; var end_time, executable, child;
@@ -352,7 +422,9 @@ function runCmd() {
exit = 0; exit = 0;
done = false; done = false;
core_1.debug("Running command " + COMMAND + " on " + OS + " using shell " + executable); core_1.debug("Running command " + COMMAND + " on " + OS + " using shell " + executable);
child = child_process_1.exec(COMMAND, { 'shell': executable }); child = attempt > 1 && NEW_COMMAND_ON_RETRY
? child_process_1.exec(NEW_COMMAND_ON_RETRY, { 'shell': executable })
: child_process_1.exec(COMMAND, { 'shell': executable });
(_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on('data', function (data) { (_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on('data', function (data) {
process.stdout.write(data); process.stdout.write(data);
}); });
@@ -399,7 +471,7 @@ function runCmd() {
} }
function runAction() { function runAction() {
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
var attempt, error_1; var attempt, error_2;
return __generator(this, function (_a) { return __generator(this, function (_a) {
switch (_a.label) { switch (_a.label) {
case 0: return [4 /*yield*/, validateInputs()]; case 0: return [4 /*yield*/, validateInputs()];
@@ -408,43 +480,47 @@ function runAction() {
attempt = 1; attempt = 1;
_a.label = 2; _a.label = 2;
case 2: case 2:
if (!(attempt <= MAX_ATTEMPTS)) return [3 /*break*/, 7]; if (!(attempt <= MAX_ATTEMPTS)) return [3 /*break*/, 13];
_a.label = 3; _a.label = 3;
case 3: case 3:
_a.trys.push([3, 5, , 6]); _a.trys.push([3, 5, , 12]);
// just keep overwriting attempts output // just keep overwriting attempts output
core_1.setOutput(OUTPUT_TOTAL_ATTEMPTS_KEY, attempt); core_1.setOutput(OUTPUT_TOTAL_ATTEMPTS_KEY, attempt);
return [4 /*yield*/, runCmd()]; return [4 /*yield*/, runCmd(attempt)];
case 4: case 4:
_a.sent(); _a.sent();
core_1.info("Command completed after " + attempt + " attempt(s)."); core_1.info("Command completed after " + attempt + " attempt(s).");
return [3 /*break*/, 7]; return [3 /*break*/, 13];
case 5: case 5:
error_1 = _a.sent(); error_2 = _a.sent();
if (attempt === MAX_ATTEMPTS) { if (!(attempt === MAX_ATTEMPTS)) return [3 /*break*/, 6];
throw new Error("Final attempt failed. " + error_1.message); throw new Error("Final attempt failed. " + error_2.message);
} case 6:
else if (!done && RETRY_ON === 'error') { if (!(!done && RETRY_ON === 'error')) return [3 /*break*/, 7];
// error: timeout // error: timeout
throw error_1; throw error_2;
} case 7:
else if (exit > 0 && RETRY_ON === 'timeout') { if (!(RETRY_ON_EXIT_CODE && RETRY_ON_EXIT_CODE !== exit)) return [3 /*break*/, 8];
// error: error throw error_2;
throw error_1; case 8:
if (!(exit > 0 && RETRY_ON === 'timeout')) return [3 /*break*/, 9];
// error: error
throw error_2;
case 9: return [4 /*yield*/, runRetryCmd()];
case 10:
_a.sent();
if (WARNING_ON_RETRY) {
core_1.warning("Attempt " + attempt + " failed. Reason: " + error_2.message);
} }
else { else {
if (WARNING_ON_RETRY) { core_1.info("Attempt " + attempt + " failed. Reason: " + error_2.message);
core_1.warning("Attempt " + attempt + " failed. Reason: " + error_1.message);
}
else {
core_1.info("Attempt " + attempt + " failed. Reason: " + error_1.message);
}
} }
return [3 /*break*/, 6]; _a.label = 11;
case 6: case 11: return [3 /*break*/, 12];
case 12:
attempt++; attempt++;
return [3 /*break*/, 2]; return [3 /*break*/, 2];
case 7: return [2 /*return*/]; case 13: return [2 /*return*/];
} }
}); });
}); });
@@ -455,12 +531,20 @@ runAction()
process.exit(0); // success process.exit(0); // success
}) })
.catch(function (err) { .catch(function (err) {
core_1.error(err.message); // exact error code if available, otherwise just 1
var exitCode = exit > 0 ? exit : 1;
if (CONTINUE_ON_ERROR) {
core_1.warning(err.message);
}
else {
core_1.error(err.message);
}
// these can be helpful to know if continue-on-error is true // these can be helpful to know if continue-on-error is true
core_1.setOutput(OUTPUT_EXIT_ERROR_KEY, err.message); core_1.setOutput(OUTPUT_EXIT_ERROR_KEY, err.message);
core_1.setOutput(OUTPUT_EXIT_CODE_KEY, exit > 0 ? exit : 1); core_1.setOutput(OUTPUT_EXIT_CODE_KEY, exitCode);
// exit with exact error code if available, otherwise just exit with 1 // if continue_on_error, exit with exact error code else exit gracefully
process.exit(exit > 0 ? exit : 1); // mimics native continue-on-error that is not supported in composite actions
process.exit(CONTINUE_ON_ERROR ? 0 : exitCode);
}); });
@@ -471,14 +555,27 @@ runAction()
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
result["default"] = mod; __setModuleDefault(result, mod);
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.issue = exports.issueCommand = void 0;
const os = __importStar(__webpack_require__(87)); const os = __importStar(__webpack_require__(87));
const utils_1 = __webpack_require__(82); const utils_1 = __webpack_require__(82);
/** /**
@@ -557,6 +654,25 @@ function escapeProperty(s) {
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
@@ -566,14 +682,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
const command_1 = __webpack_require__(431); const command_1 = __webpack_require__(431);
const file_command_1 = __webpack_require__(102); const file_command_1 = __webpack_require__(102);
const utils_1 = __webpack_require__(82); const utils_1 = __webpack_require__(82);
@@ -640,7 +750,9 @@ function addPath(inputPath) {
} }
exports.addPath = addPath; exports.addPath = addPath;
/** /**
* Gets the value of an input. The value is also trimmed. * Gets the value of an input.
* Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
* Returns an empty string if the value is not defined.
* *
* @param name name of the input to get * @param name name of the input to get
* @param options optional. See InputOptions. * @param options optional. See InputOptions.
@@ -651,9 +763,49 @@ function getInput(name, options) {
if (options && options.required && !val) { if (options && options.required && !val) {
throw new Error(`Input required and not supplied: ${name}`); throw new Error(`Input required and not supplied: ${name}`);
} }
if (options && options.trimWhitespace === false) {
return val;
}
return val.trim(); return val.trim();
} }
exports.getInput = getInput; exports.getInput = getInput;
/**
* Gets the values of an multiline input. Each value is also trimmed.
*
* @param name name of the input to get
* @param options optional. See InputOptions.
* @returns string[]
*
*/
function getMultilineInput(name, options) {
const inputs = getInput(name, options)
.split('\n')
.filter(x => x !== '');
return inputs;
}
exports.getMultilineInput = getMultilineInput;
/**
* Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
* Support boolean input list: `true | True | TRUE | false | False | FALSE` .
* The return value is also in boolean type.
* ref: https://yaml.org/spec/1.2/spec.html#id2804923
*
* @param name name of the input to get
* @param options optional. See InputOptions.
* @returns boolean
*/
function getBooleanInput(name, options) {
const trueValue = ['true', 'True', 'TRUE'];
const falseValue = ['false', 'False', 'FALSE'];
const val = getInput(name, options);
if (trueValue.includes(val))
return true;
if (falseValue.includes(val))
return false;
throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
}
exports.getBooleanInput = getBooleanInput;
/** /**
* Sets the value of an output. * Sets the value of an output.
* *
@@ -662,6 +814,7 @@ exports.getInput = getInput;
*/ */
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
function setOutput(name, value) { function setOutput(name, value) {
process.stdout.write(os.EOL);
command_1.issueCommand('set-output', { name }, value); command_1.issueCommand('set-output', { name }, value);
} }
exports.setOutput = setOutput; exports.setOutput = setOutput;
@@ -708,19 +861,30 @@ exports.debug = debug;
/** /**
* Adds an error issue * Adds an error issue
* @param message error issue message. Errors will be converted to string via toString() * @param message error issue message. Errors will be converted to string via toString()
* @param properties optional properties to add to the annotation.
*/ */
function error(message) { function error(message, properties = {}) {
command_1.issue('error', message instanceof Error ? message.toString() : message); command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
} }
exports.error = error; exports.error = error;
/** /**
* Adds an warning issue * Adds a warning issue
* @param message warning issue message. Errors will be converted to string via toString() * @param message warning issue message. Errors will be converted to string via toString()
* @param properties optional properties to add to the annotation.
*/ */
function warning(message) { function warning(message, properties = {}) {
command_1.issue('warning', message instanceof Error ? message.toString() : message); command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
} }
exports.warning = warning; exports.warning = warning;
/**
* Adds a notice issue
* @param message notice issue message. Errors will be converted to string via toString()
* @param properties optional properties to add to the annotation.
*/
function notice(message, properties = {}) {
command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
}
exports.notice = notice;
/** /**
* Writes info to log with console.log. * Writes info to log with console.log.
* @param message info message * @param message info message

301
package-lock.json generated
View File

@@ -5,9 +5,9 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@actions/core": { "@actions/core": {
"version": "1.2.6", "version": "1.5.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.5.0.tgz",
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==" "integrity": "sha512-eDOLH1Nq9zh+PJlYLqEMkS/jLQxhksPNmUGNBHfa4G+tQmnIhzpctxmchETtVGyBOvXgOVVpYuE40+eS4cUnwQ=="
}, },
"@babel/code-frame": { "@babel/code-frame": {
"version": "7.8.3", "version": "7.8.3",
@@ -104,12 +104,6 @@
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true "dev": true
}, },
"lodash": {
"version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
"dev": true
},
"supports-color": { "supports-color": {
"version": "7.2.0", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -138,14 +132,6 @@
"requires": { "requires": {
"@commitlint/types": "^11.0.0", "@commitlint/types": "^11.0.0",
"lodash": "^4.17.19" "lodash": "^4.17.19"
},
"dependencies": {
"lodash": {
"version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
"dev": true
}
} }
}, },
"@commitlint/execute-rule": { "@commitlint/execute-rule": {
@@ -313,12 +299,6 @@
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true "dev": true
}, },
"lodash": {
"version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
"dev": true
},
"parse-json": { "parse-json": {
"version": "5.1.0", "version": "5.1.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz",
@@ -385,14 +365,6 @@
"lodash": "^4.17.19", "lodash": "^4.17.19",
"resolve-from": "^5.0.0", "resolve-from": "^5.0.0",
"resolve-global": "^1.0.0" "resolve-global": "^1.0.0"
},
"dependencies": {
"lodash": {
"version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
"dev": true
}
} }
}, },
"@commitlint/rules": { "@commitlint/rules": {
@@ -1203,6 +1175,12 @@
"supports-color": "^5.3.0" "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": { "ci-info": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz",
@@ -1372,9 +1350,9 @@
} }
}, },
"hosted-git-info": { "hosted-git-info": {
"version": "3.0.7", "version": "3.0.8",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.7.tgz", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.8.tgz",
"integrity": "sha512-fWqc0IcuXs+BmE9orLDyVykAG9GJtGLGuZAAqgcckPgv5xad4AcXGIv8galtQvlwutxSlaMcdw7BUtq2EIvqCQ==", "integrity": "sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw==",
"dev": true, "dev": true,
"requires": { "requires": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -1512,9 +1490,9 @@
}, },
"dependencies": { "dependencies": {
"hosted-git-info": { "hosted-git-info": {
"version": "2.8.8", "version": "2.8.9",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
"integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
"dev": true "dev": true
}, },
"normalize-package-data": { "normalize-package-data": {
@@ -2020,6 +1998,15 @@
"universalify": "^1.0.0" "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": { "fs.realpath": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
@@ -2123,9 +2110,9 @@
} }
}, },
"hosted-git-info": { "hosted-git-info": {
"version": "3.0.7", "version": "3.0.8",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.7.tgz", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.8.tgz",
"integrity": "sha512-fWqc0IcuXs+BmE9orLDyVykAG9GJtGLGuZAAqgcckPgv5xad4AcXGIv8galtQvlwutxSlaMcdw7BUtq2EIvqCQ==", "integrity": "sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw==",
"dev": true, "dev": true,
"requires": { "requires": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -2255,9 +2242,9 @@
}, },
"dependencies": { "dependencies": {
"hosted-git-info": { "hosted-git-info": {
"version": "2.8.8", "version": "2.8.9",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
"integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
"dev": true "dev": true
}, },
"normalize-package-data": { "normalize-package-data": {
@@ -2395,9 +2382,9 @@
} }
}, },
"glob-parent": { "glob-parent": {
"version": "5.1.1", "version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dev": true, "dev": true,
"requires": { "requires": {
"is-glob": "^4.0.1" "is-glob": "^4.0.1"
@@ -2433,9 +2420,9 @@
"dev": true "dev": true
}, },
"handlebars": { "handlebars": {
"version": "4.7.6", "version": "4.7.7",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz",
"integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==",
"dev": true, "dev": true,
"requires": { "requires": {
"minimist": "^1.2.5", "minimist": "^1.2.5",
@@ -2473,9 +2460,9 @@
"dev": true "dev": true
}, },
"hosted-git-info": { "hosted-git-info": {
"version": "2.8.5", "version": "2.8.9",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
"integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
"dev": true "dev": true
}, },
"http-proxy-agent": { "http-proxy-agent": {
@@ -2630,9 +2617,9 @@
"dev": true "dev": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.8",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
"dev": true "dev": true
}, },
"into-stream": { "into-stream": {
@@ -2846,9 +2833,9 @@
} }
}, },
"lodash": { "lodash": {
"version": "4.17.15", "version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true "dev": true
}, },
"lodash._reinterpolate": { "lodash._reinterpolate": {
@@ -3092,9 +3079,9 @@
} }
}, },
"minimist": { "minimist": {
"version": "1.2.5", "version": "1.2.6",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
"dev": true "dev": true
}, },
"minimist-options": { "minimist-options": {
@@ -3107,6 +3094,50 @@
"is-plain-obj": "^1.1.0" "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": { "modify-values": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz",
@@ -3141,10 +3172,13 @@
} }
}, },
"node-fetch": { "node-fetch": {
"version": "2.6.1", "version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"dev": true "dev": true,
"requires": {
"whatwg-url": "^5.0.0"
}
}, },
"normalize-package-data": { "normalize-package-data": {
"version": "2.5.0", "version": "2.5.0",
@@ -3159,9 +3193,9 @@
} }
}, },
"normalize-url": { "normalize-url": {
"version": "5.3.0", "version": "5.3.1",
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-5.3.0.tgz", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-5.3.1.tgz",
"integrity": "sha512-9/nOVLYYe/dO/eJeQUNaGUF4m4Z5E7cb9oNTKabH+bNf19mqj60txTcveQxL0GlcWLXCxkOu2/LwL8oW0idIDA==", "integrity": "sha512-K1c7+vaAP+Yh5bOGmA10PGPpp+6h7WZrl7GwqKhUflBc9flU9pzG27DDeB9+iuhZkE3BJZOcgN1P/2sS5pqrWw==",
"dev": true "dev": true
}, },
"npm": { "npm": {
@@ -4223,7 +4257,6 @@
"fs-minipass": { "fs-minipass": {
"version": "1.2.7", "version": "1.2.7",
"bundled": true, "bundled": true,
"dev": true,
"requires": { "requires": {
"minipass": "^2.6.0" "minipass": "^2.6.0"
}, },
@@ -4231,7 +4264,6 @@
"minipass": { "minipass": {
"version": "2.9.0", "version": "2.9.0",
"bundled": true, "bundled": true,
"dev": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@@ -4475,11 +4507,6 @@
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"hosted-git-info": {
"version": "2.8.8",
"bundled": true,
"dev": true
},
"http-cache-semantics": { "http-cache-semantics": {
"version": "3.8.1", "version": "3.8.1",
"bundled": true, "bundled": true,
@@ -4571,11 +4598,6 @@
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"ini": {
"version": "1.3.5",
"bundled": true,
"dev": true
},
"init-package-json": { "init-package-json": {
"version": "1.10.3", "version": "1.10.3",
"bundled": true, "bundled": true,
@@ -5113,15 +5135,9 @@
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
}, },
"minimist": {
"version": "1.2.5",
"bundled": true,
"dev": true
},
"minizlib": { "minizlib": {
"version": "1.3.3", "version": "1.3.3",
"bundled": true, "bundled": true,
"dev": true,
"requires": { "requires": {
"minipass": "^2.9.0" "minipass": "^2.9.0"
}, },
@@ -5129,7 +5145,6 @@
"minipass": { "minipass": {
"version": "2.9.0", "version": "2.9.0",
"bundled": true, "bundled": true,
"dev": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@@ -5160,13 +5175,6 @@
"dev": true, "dev": true,
"requires": { "requires": {
"minimist": "^1.2.5" "minimist": "^1.2.5"
},
"dependencies": {
"minimist": {
"version": "1.2.5",
"bundled": true,
"dev": true
}
} }
}, },
"move-concurrently": { "move-concurrently": {
@@ -5892,8 +5900,7 @@
}, },
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true
"dev": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@@ -6212,31 +6219,6 @@
"has-flag": "^3.0.0" "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": { "term-size": {
"version": "1.2.0", "version": "1.2.0",
"bundled": true, "bundled": true,
@@ -6567,15 +6549,9 @@
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"y18n": {
"version": "4.0.0",
"bundled": true,
"dev": true
},
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true
"dev": true
}, },
"yargs": { "yargs": {
"version": "14.2.3", "version": "14.2.3",
@@ -7163,9 +7139,9 @@
} }
}, },
"hosted-git-info": { "hosted-git-info": {
"version": "3.0.7", "version": "3.0.8",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.7.tgz", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.8.tgz",
"integrity": "sha512-fWqc0IcuXs+BmE9orLDyVykAG9GJtGLGuZAAqgcckPgv5xad4AcXGIv8galtQvlwutxSlaMcdw7BUtq2EIvqCQ==", "integrity": "sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw==",
"dev": true, "dev": true,
"requires": { "requires": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -7546,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": { "temp-dir": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz",
@@ -7603,6 +7608,12 @@
"is-number": "^7.0.0" "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": { "traverse": {
"version": "0.6.6", "version": "0.6.6",
"resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz",
@@ -7621,9 +7632,9 @@
"dev": true "dev": true
}, },
"trim-off-newlines": { "trim-off-newlines": {
"version": "1.0.1", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.3.tgz",
"integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", "integrity": "sha512-kh6Tu6GbeSNMGfrrZh6Bb/4ZEHV1QlB4xNDBeog8Y9/QwFlKTRyWvY3Fs9tRDAMZliVUwieMgEdIeL/FtqjkJg==",
"dev": true "dev": true
}, },
"ts-node": { "ts-node": {
@@ -7701,6 +7712,22 @@
"spdx-expression-parse": "^3.0.0" "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": { "which": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
@@ -7778,9 +7805,9 @@
"dev": true "dev": true
}, },
"y18n": { "y18n": {
"version": "4.0.0", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==",
"dev": true "dev": true
}, },
"yallist": { "yallist": {

View File

@@ -18,7 +18,7 @@
}, },
"homepage": "https://github.com/nick-invision/retry#readme", "homepage": "https://github.com/nick-invision/retry#readme",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.6", "@actions/core": "^1.5.0",
"milliseconds": "^1.0.3", "milliseconds": "^1.0.3",
"tree-kill": "^1.2.2" "tree-kill": "^1.2.2"
}, },

View File

@@ -1,5 +1,5 @@
import { getInput, error, warning, info, debug, setOutput } from '@actions/core'; import { getInput, error, warning, info, debug, setOutput } from '@actions/core';
import { exec } from 'child_process'; import { exec, execSync } from 'child_process';
import ms from 'milliseconds'; import ms from 'milliseconds';
import kill from 'tree-kill'; import kill from 'tree-kill';
@@ -15,6 +15,10 @@ const SHELL = getInput('shell');
const POLLING_INTERVAL_SECONDS = getInputNumber('polling_interval_seconds', false) || 1; const POLLING_INTERVAL_SECONDS = getInputNumber('polling_interval_seconds', false) || 1;
const RETRY_ON = getInput('retry_on') || 'any'; const RETRY_ON = getInput('retry_on') || 'any';
const WARNING_ON_RETRY = getInput('warning_on_retry').toLowerCase() === 'true'; 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 OS = process.platform;
const OUTPUT_TOTAL_ATTEMPTS_KEY = 'total_attempts'; const OUTPUT_TOTAL_ATTEMPTS_KEY = 'total_attempts';
@@ -40,6 +44,15 @@ function getInputNumber(id: string, required: boolean): number | undefined {
return num; return num;
} }
function getInputBoolean(id: string): Boolean {
const input = getInput(id);
if (!['true','false'].includes(input.toLowerCase())) {
throw `Input ${id} only accepts boolean values. Received ${input}`;
}
return input.toLowerCase() === 'true'
}
async function retryWait() { async function retryWait() {
const waitStart = Date.now(); const waitStart = Date.now();
await wait(ms.seconds(RETRY_WAIT_SECONDS)); await wait(ms.seconds(RETRY_WAIT_SECONDS));
@@ -98,7 +111,20 @@ function getExecutable(): string {
return executable return executable
} }
async function runCmd() { async function runRetryCmd(): Promise<void> {
// if no retry script, just continue
if (!ON_RETRY_COMMAND) {
return;
}
try {
await execSync(ON_RETRY_COMMAND, { stdio: 'inherit' });
} catch (error) {
info(`WARNING: Retry command threw the error ${error.message}`)
}
}
async function runCmd(attempt: number) {
const end_time = Date.now() + getTimeout(); const end_time = Date.now() + getTimeout();
const executable = getExecutable(); const executable = getExecutable();
@@ -106,7 +132,9 @@ async function runCmd() {
done = false; done = false;
debug(`Running command ${COMMAND} on ${OS} using shell ${executable}`) debug(`Running command ${COMMAND} on ${OS} using shell ${executable}`)
var child = exec(COMMAND, { 'shell': executable }); var child = attempt > 1 && NEW_COMMAND_ON_RETRY
? exec(NEW_COMMAND_ON_RETRY, { 'shell': executable })
: exec(COMMAND, { 'shell': executable });
child.stdout?.on('data', (data) => { child.stdout?.on('data', (data) => {
process.stdout.write(data); process.stdout.write(data);
@@ -151,7 +179,7 @@ async function runAction() {
try { try {
// just keep overwriting attempts output // just keep overwriting attempts output
setOutput(OUTPUT_TOTAL_ATTEMPTS_KEY, attempt); setOutput(OUTPUT_TOTAL_ATTEMPTS_KEY, attempt);
await runCmd(); await runCmd(attempt);
info(`Command completed after ${attempt} attempt(s).`); info(`Command completed after ${attempt} attempt(s).`);
break; break;
} catch (error) { } catch (error) {
@@ -160,10 +188,13 @@ async function runAction() {
} else if (!done && RETRY_ON === 'error') { } else if (!done && RETRY_ON === 'error') {
// error: timeout // error: timeout
throw error; throw error;
} else if (RETRY_ON_EXIT_CODE && RETRY_ON_EXIT_CODE !== exit){
throw error;
} else if (exit > 0 && RETRY_ON === 'timeout') { } else if (exit > 0 && RETRY_ON === 'timeout') {
// error: error // error: error
throw error; throw error;
} else { } else {
await runRetryCmd();
if (WARNING_ON_RETRY) { if (WARNING_ON_RETRY) {
warning(`Attempt ${attempt} failed. Reason: ${error.message}`); warning(`Attempt ${attempt} failed. Reason: ${error.message}`);
} else { } else {
@@ -180,12 +211,20 @@ runAction()
process.exit(0); // success process.exit(0); // success
}) })
.catch((err) => { .catch((err) => {
error(err.message); // exact error code if available, otherwise just 1
const exitCode = exit > 0 ? exit : 1;
if (CONTINUE_ON_ERROR) {
warning(err.message);
} else {
error(err.message);
}
// these can be helpful to know if continue-on-error is true // these can be helpful to know if continue-on-error is true
setOutput(OUTPUT_EXIT_ERROR_KEY, err.message); setOutput(OUTPUT_EXIT_ERROR_KEY, err.message);
setOutput(OUTPUT_EXIT_CODE_KEY, exit > 0 ? exit : 1); setOutput(OUTPUT_EXIT_CODE_KEY, exitCode);
// exit with exact error code if available, otherwise just exit with 1 // if continue_on_error, exit with exact error code else exit gracefully
process.exit(exit > 0 ? exit : 1); // mimics native continue-on-error that is not supported in composite actions
process.exit(CONTINUE_ON_ERROR ? 0 : exitCode);
}); });