Mark job as failed on error (#14)

* fix: set failed on subprocess error

* chore: update dependencies
This commit is contained in:
Andrei Ioniță 2021-06-20 08:35:43 +01:00 committed by GitHub
commit 9eab20634f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 281 additions and 1118 deletions

43
node_modules/execa/index.d.ts generated vendored
View file

@ -334,7 +334,7 @@ declare namespace execa {
interface ExecaSyncError<StdoutErrorType = string>
extends Error,
ExecaReturnBase<StdoutErrorType> {
ExecaReturnBase<StdoutErrorType> {
/**
Error message when the child process failed to run. In addition to the underlying error message, it also contains some information related to why the child process errored.
@ -384,20 +384,6 @@ declare namespace execa {
}
interface ExecaChildPromise<StdoutErrorType> {
catch<ResultType = never>(
onRejected?: (reason: ExecaError<StdoutErrorType>) => ResultType | PromiseLike<ResultType>
): Promise<ExecaReturnValue<StdoutErrorType> | ResultType>;
/**
Same as the original [`child_process#kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal), except if `signal` is `SIGTERM` (the default value) and the child process is not terminated after 5 seconds, force it by sending `SIGKILL`.
*/
kill(signal?: string, options?: execa.KillOptions): void;
/**
Similar to [`childProcess.kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal). This is preferred when cancelling the child process execution as the error is more descriptive and [`childProcessResult.isCanceled`](#iscanceled) is set to `true`.
*/
cancel(): void;
/**
Stream combining/interleaving [`stdout`](https://nodejs.org/api/child_process.html#child_process_subprocess_stdout) and [`stderr`](https://nodejs.org/api/child_process.html#child_process_subprocess_stderr).
@ -406,11 +392,25 @@ declare namespace execa {
- both `stdout` and `stderr` options are set to [`'inherit'`, `'ipc'`, `Stream` or `integer`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio)
*/
all?: ReadableStream;
catch<ResultType = never>(
onRejected?: (reason: ExecaError<StdoutErrorType>) => ResultType | PromiseLike<ResultType>
): Promise<ExecaReturnValue<StdoutErrorType> | ResultType>;
/**
Same as the original [`child_process#kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal), except if `signal` is `SIGTERM` (the default value) and the child process is not terminated after 5 seconds, force it by sending `SIGKILL`.
*/
kill(signal?: string, options?: KillOptions): void;
/**
Similar to [`childProcess.kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal). This is preferred when cancelling the child process execution as the error is more descriptive and [`childProcessResult.isCanceled`](#iscanceled) is set to `true`.
*/
cancel(): void;
}
type ExecaChildProcess<StdoutErrorType = string> = ChildProcess &
ExecaChildPromise<StdoutErrorType> &
Promise<ExecaReturnValue<StdoutErrorType>>;
ExecaChildPromise<StdoutErrorType> &
Promise<ExecaReturnValue<StdoutErrorType>>;
}
declare const execa: {
@ -433,8 +433,13 @@ declare const execa: {
//=> 'unicorns'
// Cancelling a spawned process
const subprocess = execa('node');
setTimeout(() => { spawned.cancel() }, 1000);
setTimeout(() => {
subprocess.cancel()
}, 1000);
try {
await subprocess;
} catch (error) {
@ -459,7 +464,7 @@ declare const execa: {
): execa.ExecaChildProcess<Buffer>;
(file: string, options?: execa.Options): execa.ExecaChildProcess;
(file: string, options?: execa.Options<null>): execa.ExecaChildProcess<
Buffer
Buffer
>;
/**

2
node_modules/execa/index.js generated vendored
View file

@ -147,8 +147,6 @@ const execa = (file, args, options) => {
const handlePromiseOnce = onetime(handlePromise);
crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
handleInput(spawned, parsed.options.input);
spawned.all = makeAllStream(spawned, parsed.options);

16
node_modules/execa/lib/stdio.js generated vendored
View file

@ -1,20 +1,20 @@
'use strict';
const aliases = ['stdin', 'stdout', 'stderr'];
const hasAlias = opts => aliases.some(alias => opts[alias] !== undefined);
const hasAlias = options => aliases.some(alias => options[alias] !== undefined);
const normalizeStdio = opts => {
if (!opts) {
const normalizeStdio = options => {
if (!options) {
return;
}
const {stdio} = opts;
const {stdio} = options;
if (stdio === undefined) {
return aliases.map(alias => opts[alias]);
return aliases.map(alias => options[alias]);
}
if (hasAlias(opts)) {
if (hasAlias(options)) {
throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`);
}
@ -33,8 +33,8 @@ const normalizeStdio = opts => {
module.exports = normalizeStdio;
// `ipc` is pushed unless it is already present
module.exports.node = opts => {
const stdio = normalizeStdio(opts);
module.exports.node = options => {
const stdio = normalizeStdio(options);
if (stdio === 'ipc') {
return 'ipc';

51
node_modules/execa/package.json generated vendored
View file

@ -1,28 +1,28 @@
{
"_from": "execa",
"_id": "execa@4.1.0",
"_from": "execa@5.0.0",
"_id": "execa@5.0.0",
"_inBundle": false,
"_integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==",
"_integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==",
"_location": "/execa",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"type": "version",
"registry": true,
"raw": "execa",
"raw": "execa@5.0.0",
"name": "execa",
"escapedName": "execa",
"rawSpec": "",
"rawSpec": "5.0.0",
"saveSpec": null,
"fetchSpec": "latest"
"fetchSpec": "5.0.0"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz",
"_shasum": "4e5491ad1572f2f17a77d388c6c857135b22847a",
"_spec": "execa",
"_where": "/Users/anton/dev/action",
"_resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz",
"_shasum": "4029b0007998a841fbd1032e5f4de86a3c1e3376",
"_spec": "execa@5.0.0",
"_where": "/Users/andrei/Projects/forks/deployphp-action",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
@ -33,29 +33,28 @@
},
"bundleDependencies": false,
"dependencies": {
"cross-spawn": "^7.0.0",
"get-stream": "^5.0.0",
"human-signals": "^1.1.1",
"cross-spawn": "^7.0.3",
"get-stream": "^6.0.0",
"human-signals": "^2.1.0",
"is-stream": "^2.0.0",
"merge-stream": "^2.0.0",
"npm-run-path": "^4.0.0",
"onetime": "^5.1.0",
"signal-exit": "^3.0.2",
"npm-run-path": "^4.0.1",
"onetime": "^5.1.2",
"signal-exit": "^3.0.3",
"strip-final-newline": "^2.0.0"
},
"deprecated": false,
"description": "Process execution for humans",
"devDependencies": {
"@types/node": "^12.12.18",
"ava": "^2.1.0",
"coveralls": "^3.0.9",
"get-node": "^6.6.0",
"@types/node": "^14.14.10",
"ava": "^2.4.0",
"get-node": "^11.0.1",
"is-running": "^2.1.0",
"nyc": "^14.1.1",
"p-event": "^4.1.0",
"nyc": "^15.1.0",
"p-event": "^4.2.0",
"tempfile": "^3.0.0",
"tsd": "^0.11.0",
"xo": "^0.25.3"
"tsd": "^0.13.1",
"xo": "^0.35.0"
},
"engines": {
"node": ">=10"
@ -100,5 +99,5 @@
"scripts": {
"test": "xo && nyc ava && tsd"
},
"version": "4.1.0"
"version": "5.0.0"
}

8
node_modules/execa/readme.md generated vendored
View file

@ -1,16 +1,10 @@
<img src="media/logo.svg" width="400">
<br>
[![Build Status](https://travis-ci.com/sindresorhus/execa.svg?branch=master)](https://travis-ci.com/github/sindresorhus/execa) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/execa/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/execa?branch=master)
[![Coverage Status](https://codecov.io/gh/sindresorhus/execa/branch/master/graph/badge.svg)](https://codecov.io/gh/sindresorhus/execa)
> Process execution for humans
---
Netlify is looking for a senior/expert Node.js backend engineer to join a fully remote, international, diverse (44% women and non-binary) and friendly team. This is for the team where one of the co-maintainers [@ehmicky](https://github.com/ehmicky) is working. The job description is [here](https://boards.greenhouse.io/netlify/jobs/4832483002).
---
## Why
This package improves [`child_process`](https://nodejs.org/api/child_process.html) methods with: