Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6c3a916ee | ||
|
|
ecd3566c81 | ||
|
|
f73439ca62 | ||
|
|
bf955761b2 | ||
|
|
98bf7786db | ||
|
|
42a7ee2bf3 | ||
|
|
3268a385e5 | ||
|
|
c0bf818478 | ||
|
|
61f4c9c927 | ||
|
|
7be9d34ace | ||
|
|
06c58cac8f | ||
|
|
15706adc71 | ||
|
|
0050aaf8ea | ||
|
|
4b20200534 | ||
|
|
c29f440249 | ||
|
|
fd5dac6497 | ||
|
|
fc4847a6b6 | ||
|
|
1ed7b13f64 | ||
|
|
ccdcada15b | ||
|
|
c65fe1d313 | ||
|
|
b59969572f | ||
|
|
20feb6ca6b | ||
|
|
8f9729bafd | ||
|
|
e69a661151 | ||
|
|
dbaeeca239 | ||
|
|
83bd5c8f0c | ||
|
|
ed9d846dd6 | ||
|
|
1e72e8913e | ||
|
|
3a786d851e | ||
|
|
10811c41a0 | ||
|
|
870edb4dbb | ||
|
|
1c2045848b | ||
|
|
bc5f265c70 | ||
|
|
289ec623ba | ||
|
|
d8a47ff825 | ||
|
|
842d0dc895 | ||
|
|
9e5483b0cb | ||
|
|
e528386a92 | ||
|
|
4f37ff6724 | ||
|
|
3e407e92c5 | ||
|
|
8e5a3fbcb0 | ||
|
|
8430b10e0a | ||
|
|
f5f4f7104c | ||
|
|
f270560816 | ||
|
|
63f11125bf | ||
|
|
2166bdeb7a | ||
|
|
aa097f0a0d | ||
|
|
838fbf62b9 |
No files matched your search
@@ -1,7 +1,21 @@
|
||||
import {runCommand} from '../src/install'
|
||||
import {install, runCommand} from '../src/install'
|
||||
import * as core from '@actions/core'
|
||||
|
||||
import {expect, test} from '@jest/globals'
|
||||
|
||||
test('runCommand', async () => {
|
||||
const result = await runCommand('echo foo bar')
|
||||
expect(result).toBe('foo bar')
|
||||
})
|
||||
|
||||
async function testVersion(version: string) {
|
||||
const commandPath = await install(version)
|
||||
core.addPath(commandPath)
|
||||
const result = await runCommand('docker-compose version')
|
||||
expect(result).toContain(version)
|
||||
}
|
||||
|
||||
test('Install the right version', async () => {
|
||||
await testVersion('1.29.1')
|
||||
await testVersion('1.29.2')
|
||||
})
|
||||
Vendored
+63
-30
@@ -17,12 +17,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.install = exports.runCommand = void 0;
|
||||
const exec_1 = __nccwpck_require__(514);
|
||||
const tool_cache_1 = __nccwpck_require__(784);
|
||||
const exec_1 = __nccwpck_require__(514);
|
||||
function runCommand(command) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let output = '';
|
||||
const result = yield exec_1.exec(command, [], {
|
||||
const result = yield (0, exec_1.exec)(command, [], {
|
||||
listeners: {
|
||||
stdout: (data) => {
|
||||
output += data.toString();
|
||||
@@ -41,9 +41,10 @@ function installOnLinux(version) {
|
||||
const system = runCommand('uname -s');
|
||||
const hardware = runCommand('uname -m');
|
||||
const url = `https://github.com/docker/compose/releases/download/${version}/docker-compose-${yield system}-${yield hardware}`;
|
||||
const installerPath = yield tool_cache_1.downloadTool(url);
|
||||
yield exec_1.exec(`chmod +x ${installerPath}`);
|
||||
return installerPath;
|
||||
const installerPath = yield (0, tool_cache_1.downloadTool)(url);
|
||||
yield (0, exec_1.exec)(`chmod +x ${installerPath}`);
|
||||
const cachedPath = yield (0, tool_cache_1.cacheFile)(installerPath, 'docker-compose', 'docker-compose', version);
|
||||
return cachedPath;
|
||||
});
|
||||
}
|
||||
function install(version) {
|
||||
@@ -103,11 +104,11 @@ function run() {
|
||||
const version = core.getInput('version', {
|
||||
required: true
|
||||
});
|
||||
const commandPath = yield install_1.install(version);
|
||||
const commandPath = yield (0, install_1.install)(version);
|
||||
core.addPath(commandPath);
|
||||
}
|
||||
catch (error) {
|
||||
core.setFailed(error.message);
|
||||
core.setFailed(error instanceof Error ? error.message : 'Unknown error');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -249,7 +250,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = 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;
|
||||
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 = __nccwpck_require__(351);
|
||||
const file_command_1 = __nccwpck_require__(717);
|
||||
const utils_1 = __nccwpck_require__(278);
|
||||
@@ -427,19 +428,30 @@ exports.debug = debug;
|
||||
/**
|
||||
* Adds an error issue
|
||||
* @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) {
|
||||
command_1.issue('error', message instanceof Error ? message.toString() : message);
|
||||
function error(message, properties = {}) {
|
||||
command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
||||
}
|
||||
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 properties optional properties to add to the annotation.
|
||||
*/
|
||||
function warning(message) {
|
||||
command_1.issue('warning', message instanceof Error ? message.toString() : message);
|
||||
function warning(message, properties = {}) {
|
||||
command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
||||
}
|
||||
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.
|
||||
* @param message info message
|
||||
@@ -573,7 +585,7 @@ exports.issueCommand = issueCommand;
|
||||
// We use any as a valid input type
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.toCommandValue = void 0;
|
||||
exports.toCommandProperties = exports.toCommandValue = void 0;
|
||||
/**
|
||||
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
||||
* @param input input to sanitize into a string
|
||||
@@ -588,6 +600,25 @@ function toCommandValue(input) {
|
||||
return JSON.stringify(input);
|
||||
}
|
||||
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
|
||||
|
||||
/***/ }),
|
||||
@@ -5836,7 +5867,7 @@ module.exports = v4;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("assert");;
|
||||
module.exports = require("assert");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5844,7 +5875,7 @@ module.exports = require("assert");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("child_process");;
|
||||
module.exports = require("child_process");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5852,7 +5883,7 @@ module.exports = require("child_process");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("crypto");;
|
||||
module.exports = require("crypto");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5860,7 +5891,7 @@ module.exports = require("crypto");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("events");;
|
||||
module.exports = require("events");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5868,7 +5899,7 @@ module.exports = require("events");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("fs");;
|
||||
module.exports = require("fs");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5876,7 +5907,7 @@ module.exports = require("fs");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("http");;
|
||||
module.exports = require("http");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5884,7 +5915,7 @@ module.exports = require("http");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("https");;
|
||||
module.exports = require("https");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5892,7 +5923,7 @@ module.exports = require("https");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("net");;
|
||||
module.exports = require("net");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5900,7 +5931,7 @@ module.exports = require("net");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("os");;
|
||||
module.exports = require("os");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5908,7 +5939,7 @@ module.exports = require("os");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("path");;
|
||||
module.exports = require("path");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5916,7 +5947,7 @@ module.exports = require("path");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("stream");;
|
||||
module.exports = require("stream");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5924,7 +5955,7 @@ module.exports = require("stream");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("string_decoder");;
|
||||
module.exports = require("string_decoder");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5932,7 +5963,7 @@ module.exports = require("string_decoder");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("timers");;
|
||||
module.exports = require("timers");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5940,7 +5971,7 @@ module.exports = require("timers");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("tls");;
|
||||
module.exports = require("tls");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5948,7 +5979,7 @@ module.exports = require("tls");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("util");;
|
||||
module.exports = require("util");
|
||||
|
||||
/***/ })
|
||||
|
||||
@@ -5987,7 +6018,9 @@ module.exports = require("util");;
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/compat */
|
||||
/******/
|
||||
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
|
||||
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/
|
||||
/******/ // startup
|
||||
/******/ // Load entry module and return exports
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sources":["../webpack://@kengotoda/actions-setup-docker-compose/./lib/install.js","../webpack://@kengotoda/actions-setup-docker-compose/./lib/main.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/core/lib/command.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/core/lib/core.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/core/lib/file-command.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/core/lib/utils.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/exec/lib/exec.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/exec/lib/toolrunner.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/http-client/index.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/http-client/proxy.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/io/lib/io-util.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/io/lib/io.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/tool-cache/lib/manifest.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/tool-cache/lib/retry-helper.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/tool-cache/lib/tool-cache.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/semver/semver.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/tunnel/index.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/tunnel/lib/tunnel.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/uuid/lib/bytesToUuid.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/uuid/lib/rng.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/uuid/v4.js","../webpack://@kengotoda/actions-setup-docker-compose/external \"assert\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"child_process\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"crypto\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"events\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"fs\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"http\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"https\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"net\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"os\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"path\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"stream\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"string_decoder\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"timers\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"tls\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"util\"","../webpack://@kengotoda/actions-setup-docker-compose/webpack/bootstrap","../webpack://@kengotoda/actions-setup-docker-compose/webpack/runtime/compat","../webpack://@kengotoda/actions-setup-docker-compose/webpack/startup"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.install = exports.runCommand = void 0;\nconst exec_1 = require(\"@actions/exec\");\nconst tool_cache_1 = require(\"@actions/tool-cache\");\nfunction runCommand(command) {\n return __awaiter(this, void 0, void 0, function* () {\n let output = '';\n const result = yield exec_1.exec(command, [], {\n listeners: {\n stdout: (data) => {\n output += data.toString();\n }\n }\n });\n if (result !== 0) {\n throw new Error(`Failed to run command: ${command}`);\n }\n Line truncated
|
||||
{"version":3,"file":"index.js","sources":["../webpack://@kengotoda/actions-setup-docker-compose/./lib/install.js","../webpack://@kengotoda/actions-setup-docker-compose/./lib/main.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/core/lib/command.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/core/lib/core.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/core/lib/file-command.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/core/lib/utils.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/exec/lib/exec.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/exec/lib/toolrunner.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/http-client/index.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/http-client/proxy.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/io/lib/io-util.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/io/lib/io.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/tool-cache/lib/manifest.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/tool-cache/lib/retry-helper.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/tool-cache/lib/tool-cache.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/semver/semver.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/tunnel/index.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/tunnel/lib/tunnel.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/uuid/lib/bytesToUuid.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/uuid/lib/rng.js","../webpack://@kengotoda/actions-setup-docker-compose/./node_modules/uuid/v4.js","../webpack://@kengotoda/actions-setup-docker-compose/external \"assert\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"child_process\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"crypto\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"events\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"fs\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"http\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"https\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"net\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"os\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"path\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"stream\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"string_decoder\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"timers\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"tls\"","../webpack://@kengotoda/actions-setup-docker-compose/external \"util\"","../webpack://@kengotoda/actions-setup-docker-compose/webpack/bootstrap","../webpack://@kengotoda/actions-setup-docker-compose/webpack/runtime/compat","../webpack://@kengotoda/actions-setup-docker-compose/webpack/startup"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.install = exports.runCommand = void 0;\nconst tool_cache_1 = require(\"@actions/tool-cache\");\nconst exec_1 = require(\"@actions/exec\");\nfunction runCommand(command) {\n return __awaiter(this, void 0, void 0, function* () {\n let output = '';\n const result = yield (0, exec_1.exec)(command, [], {\n listeners: {\n stdout: (data) => {\n output += data.toString();\n }\n }\n });\n if (result !== 0) {\n throw new Error(`Failed to run command: ${command}`);\n }\n Line truncated
|
||||
Generated
+1913
-1375
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@kengotoda/actions-setup-docker-compose",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.2",
|
||||
"description": "the GitHub Action setting up docker-compose command",
|
||||
"main": "lib/main.js",
|
||||
"private": false,
|
||||
@@ -37,7 +37,7 @@
|
||||
"@semantic-release/git": "^9.0.0",
|
||||
"@types/node": "^16.3.2",
|
||||
"@typescript-eslint/parser": "^4.28.3",
|
||||
"@vercel/ncc": "^0.28.6",
|
||||
"@vercel/ncc": "^0.30.0",
|
||||
"eslint": "^7.30.0",
|
||||
"eslint-plugin-github": "^4.1.3",
|
||||
"eslint-plugin-jest": "^24.3.6",
|
||||
|
||||
+8
-2
@@ -1,5 +1,5 @@
|
||||
import {cacheFile, downloadTool} from '@actions/tool-cache'
|
||||
import {exec} from '@actions/exec'
|
||||
import {downloadTool} from '@actions/tool-cache'
|
||||
|
||||
export async function runCommand(command: string): Promise<string> {
|
||||
let output = ''
|
||||
@@ -22,7 +22,13 @@ async function installOnLinux(version: string): Promise<string> {
|
||||
const url = `https://github.com/docker/compose/releases/download/${version}/docker-compose-${await system}-${await hardware}`
|
||||
const installerPath = await downloadTool(url)
|
||||
await exec(`chmod +x ${installerPath}`)
|
||||
return installerPath
|
||||
const cachedPath = await cacheFile(
|
||||
installerPath,
|
||||
'docker-compose',
|
||||
'docker-compose',
|
||||
version
|
||||
)
|
||||
return cachedPath
|
||||
}
|
||||
|
||||
export async function install(version: string): Promise<string> {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ async function run(): Promise<void> {
|
||||
const commandPath = await install(version)
|
||||
core.addPath(commandPath)
|
||||
} catch (error) {
|
||||
core.setFailed(error.message)
|
||||
core.setFailed(error instanceof Error ? error.message : 'Unknown error')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user