From 22b63fb2e377521708b0f13808cb034ca7ab673b Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 29 Sep 2020 02:11:44 +0200 Subject: [PATCH] Adding deprecation warning (#234) --- CHANGELOG.md | 5 +++ README.md | 4 ++ action.yml | 2 + dist/index.js | 104 +++++++++++++++++++++++++++++++++++++++++--------- src/main.ts | 4 ++ 5 files changed, 100 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25c678e8..9d0d250b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 3.3.1 (2020/09/29) + +* Action moved to Docker organization (#234) +* Update deps + ## 3.3.0 (2020/08/17) * Use crazy-max/ghaction-docker-login action diff --git a/README.md b/README.md index ccb134bc..0024a69f 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,10 @@ [![Become a sponsor](https://img.shields.io/badge/sponsor-crazy--max-181717.svg?logo=github&style=flat-square)](https://github.com/sponsors/crazy-max) [![Paypal Donate](https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=flat-square)](https://www.paypal.me/crazyws) +## Moved to Docker organization + +**This action is ARCHIVED and will not receive any updates, update your workflows to use the official Docker action [docker/setup-buildx-action@v1](https://github.com/docker/setup-buildx-action)** + ## About GitHub Action to set up Docker [Buildx](https://github.com/docker/buildx). diff --git a/action.yml b/action.yml index 351c489a..a9826e0e 100644 --- a/action.yml +++ b/action.yml @@ -8,10 +8,12 @@ branding: inputs: buildx-version: + deprecationMessage: 'This action is ARCHIVED and will not receive any updates, update your workflows to use the official Docker action docker/setup-buildx-action@v1' description: 'Buildx version. Example: v0.3.0' default: 'latest' required: false qemu-version: + deprecationMessage: 'This action is ARCHIVED and will not receive any updates, update your workflows to use the official Docker action docker/setup-buildx-action@v1' description: 'QEMU static binaries Docker image version. Example: 4.2.0-7' default: 'latest' required: false diff --git a/dist/index.js b/dist/index.js index ed36010a..26c19b5d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -510,6 +510,7 @@ function run() { core.setFailed('Only supported on linux platform'); return; } + core.warning('This action is ARCHIVED and will not receive any updates, update your workflows to use the official Docker action docker/setup-buildx-action@v1'); const buildxVer = core.getInput('buildx-version') || 'latest'; const qemuVer = core.getInput('qemu-version') || 'latest'; const dockerConfigHome = process.env.DOCKER_CONFIG || path.join(os.homedir(), '.docker'); @@ -1308,6 +1309,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const command_1 = __webpack_require__(351); +const file_command_1 = __webpack_require__(717); +const utils_1 = __webpack_require__(278); const os = __importStar(__webpack_require__(87)); const path = __importStar(__webpack_require__(622)); /** @@ -1334,9 +1337,17 @@ var ExitCode; */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function exportVariable(name, val) { - const convertedVal = command_1.toCommandValue(val); + const convertedVal = utils_1.toCommandValue(val); process.env[name] = convertedVal; - command_1.issueCommand('set-env', { name }, convertedVal); + const filePath = process.env['GITHUB_ENV'] || ''; + if (filePath) { + const delimiter = '_GitHubActionsFileCommandDelimeter_'; + const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; + file_command_1.issueCommand('ENV', commandValue); + } + else { + command_1.issueCommand('set-env', { name }, convertedVal); + } } exports.exportVariable = exportVariable; /** @@ -1352,7 +1363,13 @@ exports.setSecret = setSecret; * @param inputPath */ function addPath(inputPath) { - command_1.issueCommand('add-path', {}, inputPath); + const filePath = process.env['GITHUB_PATH'] || ''; + if (filePath) { + file_command_1.issueCommand('PATH', inputPath); + } + else { + command_1.issueCommand('add-path', {}, inputPath); + } process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; } exports.addPath = addPath; @@ -1801,6 +1818,32 @@ if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { exports.debug = debug; // for test +/***/ }), + +/***/ 278: +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string + */ +function toCommandValue(input) { + if (input === null || input === undefined) { + return ''; + } + else if (typeof input === 'string' || input instanceof String) { + return input; + } + return JSON.stringify(input); +} +exports.toCommandValue = toCommandValue; +//# sourceMappingURL=utils.js.map + /***/ }), /***/ 279: @@ -1979,6 +2022,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const os = __importStar(__webpack_require__(87)); +const utils_1 = __webpack_require__(278); /** * Commands * @@ -2032,28 +2076,14 @@ class Command { return cmdStr; } } -/** - * Sanitizes an input into a string so it can be passed into issueCommand safely - * @param input input to sanitize into a string - */ -function toCommandValue(input) { - if (input === null || input === undefined) { - return ''; - } - else if (typeof input === 'string' || input instanceof String) { - return input; - } - return JSON.stringify(input); -} -exports.toCommandValue = toCommandValue; function escapeData(s) { - return toCommandValue(s) + return utils_1.toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A'); } function escapeProperty(s) { - return toCommandValue(s) + return utils_1.toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A') @@ -5195,6 +5225,42 @@ function bytesToUuid(buf, offset) { module.exports = bytesToUuid; +/***/ }), + +/***/ 717: +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +// For internal use, subject to change. +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +const fs = __importStar(__webpack_require__(747)); +const os = __importStar(__webpack_require__(87)); +const utils_1 = __webpack_require__(278); +function issueCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); + } + if (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { + encoding: 'utf8' + }); +} +exports.issueCommand = issueCommand; +//# sourceMappingURL=file-command.js.map + /***/ }), /***/ 741: diff --git a/src/main.ts b/src/main.ts index d4cc5df5..8ccc3fcf 100644 --- a/src/main.ts +++ b/src/main.ts @@ -13,6 +13,10 @@ async function run(): Promise { return; } + core.warning( + 'This action is ARCHIVED and will not receive any updates, update your workflows to use the official Docker action docker/setup-buildx-action@v1' + ); + const buildxVer: string = core.getInput('buildx-version') || 'latest'; const qemuVer: string = core.getInput('qemu-version') || 'latest'; const dockerConfigHome: string = process.env.DOCKER_CONFIG || path.join(os.homedir(), '.docker');