Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c1f7c551e | ||
|
|
cde9a1913a | ||
|
|
851300d465 | ||
|
|
39ba9c845f | ||
|
|
aa1e5622dd | ||
|
|
14d7a65708 | ||
|
|
93e94294df | ||
|
|
6e793d36ee | ||
|
|
f0cd0f993f | ||
|
|
cc1d3a4dbc | ||
|
|
a5f081bd53 | ||
|
|
32a88a3d14 | ||
|
|
10f13fc94d | ||
|
|
a7bc10bc0d | ||
|
|
53757c4d4e | ||
|
|
10115c380e | ||
|
|
9822365053 | ||
|
|
e1b6fb7a5d | ||
|
|
b162078db3 | ||
|
|
f7952001f5 | ||
|
|
a17c934fad | ||
|
|
8f88d958f5 | ||
|
|
5b199d021a | ||
|
|
54214a780d | ||
|
|
8c89fbd123 | ||
|
|
2b981e0eba | ||
|
|
436c132946 | ||
|
|
05dc7215e9 | ||
|
|
496a2134de | ||
|
|
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
+221
-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,12 +250,13 @@ 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.getIDToken = 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);
|
||||
const os = __importStar(__nccwpck_require__(87));
|
||||
const path = __importStar(__nccwpck_require__(622));
|
||||
const oidc_utils_1 = __nccwpck_require__(41);
|
||||
/**
|
||||
* The code to exit an action
|
||||
*/
|
||||
@@ -427,19 +429,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
|
||||
@@ -512,6 +525,12 @@ function getState(name) {
|
||||
return process.env[`STATE_${name}`] || '';
|
||||
}
|
||||
exports.getState = getState;
|
||||
function getIDToken(aud) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return yield oidc_utils_1.OidcClient.getIDToken(aud);
|
||||
});
|
||||
}
|
||||
exports.getIDToken = getIDToken;
|
||||
//# sourceMappingURL=core.js.map
|
||||
|
||||
/***/ }),
|
||||
@@ -565,6 +584,90 @@ exports.issueCommand = issueCommand;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 41:
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.OidcClient = void 0;
|
||||
const http_client_1 = __nccwpck_require__(925);
|
||||
const auth_1 = __nccwpck_require__(702);
|
||||
const core_1 = __nccwpck_require__(186);
|
||||
class OidcClient {
|
||||
static createHttpClient(allowRetry = true, maxRetry = 10) {
|
||||
const requestOptions = {
|
||||
allowRetries: allowRetry,
|
||||
maxRetries: maxRetry
|
||||
};
|
||||
return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
|
||||
}
|
||||
static getRequestToken() {
|
||||
const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
|
||||
if (!token) {
|
||||
throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
|
||||
}
|
||||
return token;
|
||||
}
|
||||
static getIDTokenUrl() {
|
||||
const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
|
||||
if (!runtimeUrl) {
|
||||
throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
|
||||
}
|
||||
return runtimeUrl;
|
||||
}
|
||||
static getCall(id_token_url) {
|
||||
var _a;
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const httpclient = OidcClient.createHttpClient();
|
||||
const res = yield httpclient
|
||||
.getJson(id_token_url)
|
||||
.catch(error => {
|
||||
throw new Error(`Failed to get ID Token. \n
|
||||
Error Code : ${error.statusCode}\n
|
||||
Error Message: ${error.result.message}`);
|
||||
});
|
||||
const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
|
||||
if (!id_token) {
|
||||
throw new Error('Response json body do not have ID Token field');
|
||||
}
|
||||
return id_token;
|
||||
});
|
||||
}
|
||||
static getIDToken(audience) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
// New ID Token is requested from action service
|
||||
let id_token_url = OidcClient.getIDTokenUrl();
|
||||
if (audience) {
|
||||
const encodedAudience = encodeURIComponent(audience);
|
||||
id_token_url = `${id_token_url}&audience=${encodedAudience}`;
|
||||
}
|
||||
core_1.debug(`ID token url is ${id_token_url}`);
|
||||
const id_token = yield OidcClient.getCall(id_token_url);
|
||||
core_1.setSecret(id_token);
|
||||
return id_token;
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error(`Error message: ${error.message}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.OidcClient = OidcClient;
|
||||
//# sourceMappingURL=oidc-utils.js.map
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 278:
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
@@ -573,7 +676,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 +691,26 @@ 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,
|
||||
file: annotationProperties.file,
|
||||
line: annotationProperties.startLine,
|
||||
endLine: annotationProperties.endLine,
|
||||
col: annotationProperties.startColumn,
|
||||
endColumn: annotationProperties.endColumn
|
||||
};
|
||||
}
|
||||
exports.toCommandProperties = toCommandProperties;
|
||||
//# sourceMappingURL=utils.js.map
|
||||
|
||||
/***/ }),
|
||||
@@ -1325,6 +1448,72 @@ class ExecState extends events.EventEmitter {
|
||||
}
|
||||
//# sourceMappingURL=toolrunner.js.map
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 702:
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
class BasicCredentialHandler {
|
||||
constructor(username, password) {
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
}
|
||||
prepareRequest(options) {
|
||||
options.headers['Authorization'] =
|
||||
'Basic ' +
|
||||
Buffer.from(this.username + ':' + this.password).toString('base64');
|
||||
}
|
||||
// This handler cannot handle 401
|
||||
canHandleAuthentication(response) {
|
||||
return false;
|
||||
}
|
||||
handleAuthentication(httpClient, requestInfo, objs) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
exports.BasicCredentialHandler = BasicCredentialHandler;
|
||||
class BearerCredentialHandler {
|
||||
constructor(token) {
|
||||
this.token = token;
|
||||
}
|
||||
// currently implements pre-authorization
|
||||
// TODO: support preAuth = false where it hooks on 401
|
||||
prepareRequest(options) {
|
||||
options.headers['Authorization'] = 'Bearer ' + this.token;
|
||||
}
|
||||
// This handler cannot handle 401
|
||||
canHandleAuthentication(response) {
|
||||
return false;
|
||||
}
|
||||
handleAuthentication(httpClient, requestInfo, objs) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
exports.BearerCredentialHandler = BearerCredentialHandler;
|
||||
class PersonalAccessTokenCredentialHandler {
|
||||
constructor(token) {
|
||||
this.token = token;
|
||||
}
|
||||
// currently implements pre-authorization
|
||||
// TODO: support preAuth = false where it hooks on 401
|
||||
prepareRequest(options) {
|
||||
options.headers['Authorization'] =
|
||||
'Basic ' + Buffer.from('PAT:' + this.token).toString('base64');
|
||||
}
|
||||
// This handler cannot handle 401
|
||||
canHandleAuthentication(response) {
|
||||
return false;
|
||||
}
|
||||
handleAuthentication(httpClient, requestInfo, objs) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 925:
|
||||
@@ -5836,7 +6025,7 @@ module.exports = v4;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("assert");;
|
||||
module.exports = require("assert");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5844,7 +6033,7 @@ module.exports = require("assert");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("child_process");;
|
||||
module.exports = require("child_process");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5852,7 +6041,7 @@ module.exports = require("child_process");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("crypto");;
|
||||
module.exports = require("crypto");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5860,7 +6049,7 @@ module.exports = require("crypto");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("events");;
|
||||
module.exports = require("events");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5868,7 +6057,7 @@ module.exports = require("events");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("fs");;
|
||||
module.exports = require("fs");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5876,7 +6065,7 @@ module.exports = require("fs");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("http");;
|
||||
module.exports = require("http");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5884,7 +6073,7 @@ module.exports = require("http");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("https");;
|
||||
module.exports = require("https");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5892,7 +6081,7 @@ module.exports = require("https");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("net");;
|
||||
module.exports = require("net");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5900,7 +6089,7 @@ module.exports = require("net");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("os");;
|
||||
module.exports = require("os");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5908,7 +6097,7 @@ module.exports = require("os");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("path");;
|
||||
module.exports = require("path");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5916,7 +6105,7 @@ module.exports = require("path");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("stream");;
|
||||
module.exports = require("stream");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5924,7 +6113,7 @@ module.exports = require("stream");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("string_decoder");;
|
||||
module.exports = require("string_decoder");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5932,7 +6121,7 @@ module.exports = require("string_decoder");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("timers");;
|
||||
module.exports = require("timers");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5940,7 +6129,7 @@ module.exports = require("timers");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("tls");;
|
||||
module.exports = require("tls");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -5948,7 +6137,7 @@ module.exports = require("tls");;
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("util");;
|
||||
module.exports = require("util");
|
||||
|
||||
/***/ })
|
||||
|
||||
@@ -5987,7 +6176,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/oidc-utils.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/auth.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 Line truncated
|
||||
Generated
+1996
-1480
File diff suppressed because it is too large.
Load diff
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@kengotoda/actions-setup-docker-compose",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.3",
|
||||
"description": "the GitHub Action setting up docker-compose command",
|
||||
"main": "lib/main.js",
|
||||
"private": false,
|
||||
@@ -37,13 +37,13 @@
|
||||
"@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.31.0",
|
||||
"eslint": "^7.30.0",
|
||||
"eslint-plugin-github": "^4.1.3",
|
||||
"eslint-plugin-jest": "^24.3.6",
|
||||
"jest": "^27.0.6",
|
||||
"js-yaml": "^4.1.0",
|
||||
"prettier": "2.3.2",
|
||||
"prettier": "2.4.1",
|
||||
"semantic-release": "^17.4.4",
|
||||
"ts-jest": "^27.0.3",
|
||||
"typescript": "^4.3.5"
|
||||
|
||||
+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