mirror of
https://github.com/nick-fields/retry.git
synced 2026-02-10 23:25:28 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c36bd33fae | ||
|
|
ad6c447324 | ||
|
|
36c6f604ab | ||
|
|
31e0097983 | ||
|
|
7a4513731b | ||
|
|
0a47821646 | ||
|
|
193acc1924 | ||
|
|
8965a748e1 |
20
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: nick-invision
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is, **including the snippet from your workflow `yaml` showing your configuration and command being executed.**
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Logs**
|
||||||
|
Enable [debug logging](https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/enabling-debug-logging#enabling-step-debug-logging) then attach the [raw logs](https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/using-workflow-run-logs#downloading-logs) (specifically the raw output of this action).
|
||||||
3
.github/scripts/log-examples.js
vendored
Normal file
3
.github/scripts/log-examples.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
console.log('console.log test');
|
||||||
|
process.stdout.write('stdout test\n');
|
||||||
|
process.stderr.write('stderr test\n');
|
||||||
6
.github/workflows/ci_cd.yml
vendored
6
.github/workflows/ci_cd.yml
vendored
@@ -31,6 +31,12 @@ jobs:
|
|||||||
expected: true
|
expected: true
|
||||||
actual: ${{ steps.happy_path.outputs.total_attempts == '1' && steps.happy_path.outputs.exit_code == '0' }}
|
actual: ${{ steps.happy_path.outputs.total_attempts == '1' && steps.happy_path.outputs.exit_code == '0' }}
|
||||||
|
|
||||||
|
- name: log examples
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
command: node ./.github/scripts/log-examples.js
|
||||||
|
timeout_minutes: 1
|
||||||
|
|
||||||
- name: sad-path (retry_wait_seconds)
|
- name: sad-path (retry_wait_seconds)
|
||||||
id: sad_path_wait_sec
|
id: sad_path_wait_sec
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
12
dist/exec.js
vendored
12
dist/exec.js
vendored
@@ -1,12 +0,0 @@
|
|||||||
const { exec } = require('child_process');
|
|
||||||
const COMMAND = process.argv.splice(2)[0];
|
|
||||||
|
|
||||||
function run() {
|
|
||||||
exec(COMMAND, { stdio: 'inherit' }, (err) => {
|
|
||||||
if (err) {
|
|
||||||
process.exit(err.code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
run();
|
|
||||||
14
dist/index.js
vendored
14
dist/index.js
vendored
@@ -415,7 +415,7 @@ module.exports = require("path");
|
|||||||
/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
|
/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
|
||||||
|
|
||||||
const { getInput, error, warning, info, debug, setOutput } = __webpack_require__(470);
|
const { getInput, error, warning, info, debug, setOutput } = __webpack_require__(470);
|
||||||
const { spawn } = __webpack_require__(129);
|
const child_process = __webpack_require__(129);
|
||||||
const { join } = __webpack_require__(622);
|
const { join } = __webpack_require__(622);
|
||||||
const ms = __webpack_require__(156);
|
const ms = __webpack_require__(156);
|
||||||
var kill = __webpack_require__(791);
|
var kill = __webpack_require__(791);
|
||||||
@@ -489,7 +489,17 @@ async function runCmd() {
|
|||||||
exit = 0;
|
exit = 0;
|
||||||
done = false;
|
done = false;
|
||||||
|
|
||||||
var child = spawn('node', [__webpack_require__.ab + "exec.js", COMMAND], { stdio: 'inherit' });
|
const file = COMMAND.split(' ')[0];
|
||||||
|
const args = COMMAND.split(' ').slice(1);
|
||||||
|
|
||||||
|
var child = child_process.exec(COMMAND, { stdio: 'inherit' });
|
||||||
|
|
||||||
|
child.stdout.on('data', (data) => {
|
||||||
|
console.log(data);
|
||||||
|
});
|
||||||
|
child.stderr.on('data', (data) => {
|
||||||
|
console.log(data);
|
||||||
|
});
|
||||||
|
|
||||||
child.on('exit', (code, signal) => {
|
child.on('exit', (code, signal) => {
|
||||||
debug(`Code: ${code}`);
|
debug(`Code: ${code}`);
|
||||||
|
|||||||
6
package-lock.json
generated
6
package-lock.json
generated
@@ -5,9 +5,9 @@
|
|||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": {
|
"@actions/core": {
|
||||||
"version": "1.2.4",
|
"version": "1.2.6",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
|
||||||
"integrity": "sha512-YJCEq8BE3CdN8+7HPZ/4DxJjk/OkZV2FFIf+DlZTC/4iBlzYCD5yjRR6eiOS5llO11zbRltIRuKAjMKaWTE6cg=="
|
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
|
||||||
},
|
},
|
||||||
"@babel/code-frame": {
|
"@babel/code-frame": {
|
||||||
"version": "7.8.3",
|
"version": "7.8.3",
|
||||||
|
|||||||
@@ -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.4",
|
"@actions/core": "^1.2.6",
|
||||||
"milliseconds": "^1.0.3",
|
"milliseconds": "^1.0.3",
|
||||||
"tree-kill": "^1.2.2"
|
"tree-kill": "^1.2.2"
|
||||||
},
|
},
|
||||||
|
|||||||
12
src/exec.js
12
src/exec.js
@@ -1,12 +0,0 @@
|
|||||||
const { exec } = require('child_process');
|
|
||||||
const COMMAND = process.argv.splice(2)[0];
|
|
||||||
|
|
||||||
function run() {
|
|
||||||
exec(COMMAND, { stdio: 'inherit' }, (err) => {
|
|
||||||
if (err) {
|
|
||||||
process.exit(err.code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
run();
|
|
||||||
14
src/index.js
14
src/index.js
@@ -1,5 +1,5 @@
|
|||||||
const { getInput, error, warning, info, debug, setOutput } = require('@actions/core');
|
const { getInput, error, warning, info, debug, setOutput } = require('@actions/core');
|
||||||
const { spawn } = require('child_process');
|
const child_process = require('child_process');
|
||||||
const { join } = require('path');
|
const { join } = require('path');
|
||||||
const ms = require('milliseconds');
|
const ms = require('milliseconds');
|
||||||
var kill = require('tree-kill');
|
var kill = require('tree-kill');
|
||||||
@@ -73,7 +73,17 @@ async function runCmd() {
|
|||||||
exit = 0;
|
exit = 0;
|
||||||
done = false;
|
done = false;
|
||||||
|
|
||||||
var child = spawn('node', [join(__dirname, 'exec.js'), COMMAND], { stdio: 'inherit' });
|
const file = COMMAND.split(' ')[0];
|
||||||
|
const args = COMMAND.split(' ').slice(1);
|
||||||
|
|
||||||
|
var child = child_process.exec(COMMAND, { stdio: 'inherit' });
|
||||||
|
|
||||||
|
child.stdout.on('data', (data) => {
|
||||||
|
console.log(data);
|
||||||
|
});
|
||||||
|
child.stderr.on('data', (data) => {
|
||||||
|
console.log(data);
|
||||||
|
});
|
||||||
|
|
||||||
child.on('exit', (code, signal) => {
|
child.on('exit', (code, signal) => {
|
||||||
debug(`Code: ${code}`);
|
debug(`Code: ${code}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user