Compare commits

...

8 Commits

Author SHA1 Message Date
Nick Fields
c36bd33fae Merge pull request #20 from nick-invision/snyk-fix-2977ebb55dda5c312597a1469964ea24
[Snyk] Security upgrade @actions/core from 1.2.4 to 1.2.6
2020-11-14 09:58:58 -05:00
Nick Fields
ad6c447324 Merge pull request #22 from nick-invision/nrf/add-logging-test
Fix command output
2020-11-14 09:57:12 -05:00
Nick Fields
36c6f604ab fix: handle errors properly 2020-11-14 09:11:33 -05:00
Nick Fields
31e0097983 fix: make command spawnable to fix log issue 2020-10-31 10:43:28 -04:00
Nick Fields
7a4513731b test: add timeout_minutes 2020-10-30 19:57:42 -04:00
Nick Fields
0a47821646 test: add log example to ci workflow 2020-10-30 19:49:12 -04:00
Nick Fields
193acc1924 Update issue templates 2020-10-30 19:44:01 -04:00
snyk-bot
8965a748e1 fix: package.json & package-lock.json to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-ACTIONSCORE-1015402
2020-10-03 00:51:03 +00:00
9 changed files with 57 additions and 32 deletions

20
.github/ISSUE_TEMPLATE/bug-report.md vendored Normal file
View 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
View File

@@ -0,0 +1,3 @@
console.log('console.log test');
process.stdout.write('stdout test\n');
process.stderr.write('stderr test\n');

View File

@@ -31,6 +31,12 @@ jobs:
expected: true
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)
id: sad_path_wait_sec
uses: ./

12
dist/exec.js vendored
View File

@@ -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
View File

@@ -415,7 +415,7 @@ module.exports = require("path");
/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
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 ms = __webpack_require__(156);
var kill = __webpack_require__(791);
@@ -489,7 +489,17 @@ async function runCmd() {
exit = 0;
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) => {
debug(`Code: ${code}`);

6
package-lock.json generated
View File

@@ -5,9 +5,9 @@
"requires": true,
"dependencies": {
"@actions/core": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.4.tgz",
"integrity": "sha512-YJCEq8BE3CdN8+7HPZ/4DxJjk/OkZV2FFIf+DlZTC/4iBlzYCD5yjRR6eiOS5llO11zbRltIRuKAjMKaWTE6cg=="
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
},
"@babel/code-frame": {
"version": "7.8.3",

View File

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

View File

@@ -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();

View File

@@ -1,5 +1,5 @@
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 ms = require('milliseconds');
var kill = require('tree-kill');
@@ -73,7 +73,17 @@ async function runCmd() {
exit = 0;
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) => {
debug(`Code: ${code}`);