mirror of
https://github.com/nick-fields/retry.git
synced 2026-02-10 07:05:29 +00:00
Compare commits
5 Commits
v2.8.3
...
snyk-upgra
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de8a18d041 | ||
|
|
14672906e6 | ||
|
|
1139f998ef | ||
|
|
1d41e5db1a | ||
|
|
1859f94181 |
24
.github/workflows/ci_cd.yml
vendored
24
.github/workflows/ci_cd.yml
vendored
@@ -1,12 +1,16 @@
|
|||||||
name: CI/CD
|
name: CI/CD
|
||||||
on:
|
on:
|
||||||
|
# only on PRs into and merge to default branch
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# runs on branch pushes only
|
|
||||||
ci_unit:
|
ci_unit:
|
||||||
name: Run Unit Tests
|
name: Run Unit Tests
|
||||||
if: startsWith(github.ref, 'refs/heads')
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -26,7 +30,6 @@ jobs:
|
|||||||
|
|
||||||
ci_integration:
|
ci_integration:
|
||||||
name: Run Integration Tests
|
name: Run Integration Tests
|
||||||
if: startsWith(github.ref, 'refs/heads')
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -137,7 +140,6 @@ jobs:
|
|||||||
|
|
||||||
ci_integration_envvar:
|
ci_integration_envvar:
|
||||||
name: Run Integration Env Var Tests
|
name: Run Integration Env Var Tests
|
||||||
if: startsWith(github.ref, 'refs/heads')
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -159,7 +161,6 @@ jobs:
|
|||||||
|
|
||||||
ci_integration_large_output:
|
ci_integration_large_output:
|
||||||
name: Run Integration Large Output Tests
|
name: Run Integration Large Output Tests
|
||||||
if: startsWith(github.ref, 'refs/heads')
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -191,7 +192,6 @@ jobs:
|
|||||||
|
|
||||||
ci_integration_retry_on_exit_code:
|
ci_integration_retry_on_exit_code:
|
||||||
name: Run Integration retry_on_exit_code Tests
|
name: Run Integration retry_on_exit_code Tests
|
||||||
if: startsWith(github.ref, 'refs/heads')
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -240,7 +240,6 @@ jobs:
|
|||||||
|
|
||||||
ci_integration_continue_on_error:
|
ci_integration_continue_on_error:
|
||||||
name: Run Integration continue_on_error Tests
|
name: Run Integration continue_on_error Tests
|
||||||
if: startsWith(github.ref, 'refs/heads')
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -288,7 +287,6 @@ jobs:
|
|||||||
|
|
||||||
ci_integration_retry_wait_seconds:
|
ci_integration_retry_wait_seconds:
|
||||||
name: Run Integration Tests (retry_wait_seconds)
|
name: Run Integration Tests (retry_wait_seconds)
|
||||||
if: startsWith(github.ref, 'refs/heads')
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -325,7 +323,6 @@ jobs:
|
|||||||
|
|
||||||
ci_integration_on_retry_cmd:
|
ci_integration_on_retry_cmd:
|
||||||
name: Run Integration Tests (on_retry_command)
|
name: Run Integration Tests (on_retry_command)
|
||||||
if: startsWith(github.ref, 'refs/heads')
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -369,7 +366,6 @@ jobs:
|
|||||||
# timeout tests take longer to run so run in parallel
|
# timeout tests take longer to run so run in parallel
|
||||||
ci_integration_timeout_seconds:
|
ci_integration_timeout_seconds:
|
||||||
name: Run Integration Timeout Tests (seconds)
|
name: Run Integration Timeout Tests (seconds)
|
||||||
if: startsWith(github.ref, 'refs/heads')
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -400,7 +396,6 @@ jobs:
|
|||||||
|
|
||||||
ci_integration_timeout_retry_on_timeout:
|
ci_integration_timeout_retry_on_timeout:
|
||||||
name: Run Integration Timeout Tests (retry_on timeout)
|
name: Run Integration Timeout Tests (retry_on timeout)
|
||||||
if: startsWith(github.ref, 'refs/heads')
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -432,7 +427,6 @@ jobs:
|
|||||||
|
|
||||||
ci_integration_timeout_retry_on_error:
|
ci_integration_timeout_retry_on_error:
|
||||||
name: Run Integration Timeout Tests (retry_on error)
|
name: Run Integration Timeout Tests (retry_on error)
|
||||||
if: startsWith(github.ref, 'refs/heads')
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -468,7 +462,6 @@ jobs:
|
|||||||
|
|
||||||
ci_integration_timeout_minutes:
|
ci_integration_timeout_minutes:
|
||||||
name: Run Integration Timeout Tests (minutes)
|
name: Run Integration Timeout Tests (minutes)
|
||||||
if: startsWith(github.ref, 'refs/heads')
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -499,7 +492,6 @@ jobs:
|
|||||||
|
|
||||||
ci_windows:
|
ci_windows:
|
||||||
name: Run Windows Tests
|
name: Run Windows Tests
|
||||||
if: startsWith(github.ref, 'refs/heads')
|
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -571,7 +563,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- run: echo "If this is hit, all tests successfully passed"
|
- run: echo "If this is hit, all tests successfully passed"
|
||||||
|
|
||||||
# runs on push to master only
|
# runs on merge to default only
|
||||||
cd:
|
cd:
|
||||||
name: Publish Action
|
name: Publish Action
|
||||||
needs: [ci_all_tests_passed]
|
needs: [ci_all_tests_passed]
|
||||||
@@ -588,7 +580,7 @@ jobs:
|
|||||||
run: npm ci
|
run: npm ci
|
||||||
- name: Release
|
- name: Release
|
||||||
id: semantic
|
id: semantic
|
||||||
uses: cycjimmy/semantic-release-action@v2
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Tag
|
- name: Tag
|
||||||
|
|||||||
11
dist/index.js
vendored
11
dist/index.js
vendored
@@ -948,7 +948,8 @@ function getExecutable(inputs) {
|
|||||||
return OS === 'win32' ? 'powershell' : 'bash';
|
return OS === 'win32' ? 'powershell' : 'bash';
|
||||||
}
|
}
|
||||||
var executable;
|
var executable;
|
||||||
switch (inputs.shell) {
|
var shellName = inputs.shell.split(' ')[0];
|
||||||
|
switch (shellName) {
|
||||||
case 'bash':
|
case 'bash':
|
||||||
case 'python':
|
case 'python':
|
||||||
case 'pwsh': {
|
case 'pwsh': {
|
||||||
@@ -957,7 +958,7 @@ function getExecutable(inputs) {
|
|||||||
}
|
}
|
||||||
case 'sh': {
|
case 'sh': {
|
||||||
if (OS === 'win32') {
|
if (OS === 'win32') {
|
||||||
throw new Error("Shell ".concat(inputs.shell, " not allowed on OS ").concat(OS));
|
throw new Error("Shell ".concat(shellName, " not allowed on OS ").concat(OS));
|
||||||
}
|
}
|
||||||
executable = inputs.shell;
|
executable = inputs.shell;
|
||||||
break;
|
break;
|
||||||
@@ -965,13 +966,13 @@ function getExecutable(inputs) {
|
|||||||
case 'cmd':
|
case 'cmd':
|
||||||
case 'powershell': {
|
case 'powershell': {
|
||||||
if (OS !== 'win32') {
|
if (OS !== 'win32') {
|
||||||
throw new Error("Shell ".concat(inputs.shell, " not allowed on OS ").concat(OS));
|
throw new Error("Shell ".concat(shellName, " not allowed on OS ").concat(OS));
|
||||||
}
|
}
|
||||||
executable = inputs.shell + '.exe';
|
executable = shellName + '.exe' + inputs.shell.replace(shellName, '');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
throw new Error("Shell ".concat(inputs.shell, " not supported. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell for supported shells"));
|
throw new Error("Shell ".concat(shellName, " not supported. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell for supported shells"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return executable;
|
return executable;
|
||||||
|
|||||||
14
package-lock.json
generated
14
package-lock.json
generated
@@ -9,7 +9,7 @@
|
|||||||
"version": "0.0.0-managed-by-semantic-release",
|
"version": "0.0.0-managed-by-semantic-release",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.1",
|
||||||
"milliseconds": "^1.0.3",
|
"milliseconds": "^1.0.3",
|
||||||
"tree-kill": "^1.2.2"
|
"tree-kill": "^1.2.2"
|
||||||
},
|
},
|
||||||
@@ -39,9 +39,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
"version": "1.10.0",
|
"version": "1.10.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz",
|
||||||
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
"integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"uuid": "^8.3.2"
|
"uuid": "^8.3.2"
|
||||||
@@ -13090,9 +13090,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": {
|
"@actions/core": {
|
||||||
"version": "1.10.0",
|
"version": "1.10.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz",
|
||||||
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
"integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"uuid": "^8.3.2"
|
"uuid": "^8.3.2"
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/nick-invision/retry#readme",
|
"homepage": "https://github.com/nick-invision/retry#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.1",
|
||||||
"milliseconds": "^1.0.3",
|
"milliseconds": "^1.0.3",
|
||||||
"tree-kill": "^1.2.2"
|
"tree-kill": "^1.2.2"
|
||||||
},
|
},
|
||||||
|
|||||||
12
src/index.ts
12
src/index.ts
@@ -20,7 +20,9 @@ function getExecutable(inputs: Inputs): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let executable: string;
|
let executable: string;
|
||||||
switch (inputs.shell) {
|
const shellName = inputs.shell.split(' ')[0];
|
||||||
|
|
||||||
|
switch (shellName) {
|
||||||
case 'bash':
|
case 'bash':
|
||||||
case 'python':
|
case 'python':
|
||||||
case 'pwsh': {
|
case 'pwsh': {
|
||||||
@@ -29,7 +31,7 @@ function getExecutable(inputs: Inputs): string {
|
|||||||
}
|
}
|
||||||
case 'sh': {
|
case 'sh': {
|
||||||
if (OS === 'win32') {
|
if (OS === 'win32') {
|
||||||
throw new Error(`Shell ${inputs.shell} not allowed on OS ${OS}`);
|
throw new Error(`Shell ${shellName} not allowed on OS ${OS}`);
|
||||||
}
|
}
|
||||||
executable = inputs.shell;
|
executable = inputs.shell;
|
||||||
break;
|
break;
|
||||||
@@ -37,14 +39,14 @@ function getExecutable(inputs: Inputs): string {
|
|||||||
case 'cmd':
|
case 'cmd':
|
||||||
case 'powershell': {
|
case 'powershell': {
|
||||||
if (OS !== 'win32') {
|
if (OS !== 'win32') {
|
||||||
throw new Error(`Shell ${inputs.shell} not allowed on OS ${OS}`);
|
throw new Error(`Shell ${shellName} not allowed on OS ${OS}`);
|
||||||
}
|
}
|
||||||
executable = inputs.shell + '.exe';
|
executable = shellName + '.exe' + inputs.shell.replace(shellName, '');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Shell ${inputs.shell} not supported. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell for supported shells`
|
`Shell ${shellName} not supported. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell for supported shells`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user