Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a08dc762e8 | |||
| b84268f0e0 | |||
| d1b97ebf4d | |||
| baf8bc61f1 | |||
| 8edd152f63 | |||
| 2d275a8f2d |
Vendored
+2
-58
@@ -3370,16 +3370,6 @@ const compare = (a, b, loose) =>
|
||||
module.exports = compare
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1898:
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
const compare = __nccwpck_require__(4309)
|
||||
const eq = (a, b, loose) => compare(a, b, loose) === 0
|
||||
module.exports = eq
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 4123:
|
||||
@@ -28618,17 +28608,14 @@ __nccwpck_require__.d(__webpack_exports__, {
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js
|
||||
var core = __nccwpck_require__(2186);
|
||||
// EXTERNAL MODULE: ./node_modules/@actions/exec/lib/exec.js
|
||||
var exec = __nccwpck_require__(1514);
|
||||
// EXTERNAL MODULE: ./node_modules/semver/functions/eq.js
|
||||
var eq = __nccwpck_require__(1898);
|
||||
var eq_default = /*#__PURE__*/__nccwpck_require__.n(eq);
|
||||
;// CONCATENATED MODULE: external "node:child_process"
|
||||
const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process");
|
||||
;// CONCATENATED MODULE: external "node:os"
|
||||
const external_node_os_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os");
|
||||
// EXTERNAL MODULE: external "node:util"
|
||||
var external_node_util_ = __nccwpck_require__(7261);
|
||||
// EXTERNAL MODULE: ./node_modules/@actions/exec/lib/exec.js
|
||||
var exec = __nccwpck_require__(1514);
|
||||
;// CONCATENATED MODULE: ./src/exec.ts
|
||||
|
||||
|
||||
@@ -28744,15 +28731,12 @@ function getPackageManager(name, { workingDirectory = "." } = {}) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const DEFAULT_WRANGLER_VERSION = "3.13.2";
|
||||
/**
|
||||
* A configuration object that contains all the inputs & immutable state for the action.
|
||||
*/
|
||||
const config = {
|
||||
WRANGLER_VERSION: (0,core.getInput)("wranglerVersion") || DEFAULT_WRANGLER_VERSION,
|
||||
didUserProvideWranglerVersion: Boolean((0,core.getInput)("wranglerVersion")),
|
||||
secrets: (0,core.getMultilineInput)("secrets"),
|
||||
workingDirectory: checkWorkingDirectory((0,core.getInput)("workingDirectory")),
|
||||
CLOUDFLARE_API_TOKEN: (0,core.getInput)("apiToken"),
|
||||
@@ -28805,46 +28789,6 @@ async function installWrangler() {
|
||||
if (config["WRANGLER_VERSION"].startsWith("1")) {
|
||||
throw new Error(`Wrangler v1 is no longer supported by this action. Please use major version 2 or greater`);
|
||||
}
|
||||
startGroup("🔍 Checking for existing Wrangler installation");
|
||||
let installedVersion = "";
|
||||
let installedVersionSatisfiesRequirement = false;
|
||||
try {
|
||||
const { stdout } = await (0,exec.getExecOutput)(packageManager.exec, ["wrangler", "--version"], {
|
||||
cwd: config["workingDirectory"],
|
||||
silent: config.QUIET_MODE,
|
||||
});
|
||||
// There are two possible outputs from `wrangler --version`:
|
||||
// ` ⛅️ wrangler 3.48.0 (update available 3.53.1)`
|
||||
// and
|
||||
// `3.48.0`
|
||||
const versionMatch = stdout.match(/wrangler (\d+\.\d+\.\d+)/) ??
|
||||
stdout.match(/^(\d+\.\d+\.\d+)/);
|
||||
if (versionMatch) {
|
||||
installedVersion = versionMatch[1];
|
||||
}
|
||||
if (config.didUserProvideWranglerVersion) {
|
||||
installedVersionSatisfiesRequirement = eq_default()(installedVersion, config["WRANGLER_VERSION"]);
|
||||
}
|
||||
if (!config.didUserProvideWranglerVersion && installedVersion) {
|
||||
info(`✅ No wrangler version specified, using pre-installed wrangler version ${installedVersion}`, true);
|
||||
endGroup();
|
||||
return;
|
||||
}
|
||||
if (config.didUserProvideWranglerVersion &&
|
||||
installedVersionSatisfiesRequirement) {
|
||||
info(`✅ Using Wrangler ${installedVersion}`, true);
|
||||
endGroup();
|
||||
return;
|
||||
}
|
||||
info("⚠️ Wrangler not found or version is incompatible. Installing...", true);
|
||||
}
|
||||
catch (error) {
|
||||
(0,core.debug)(`Error checking Wrangler version: ${error}`);
|
||||
info("⚠️ Wrangler not found or version is incompatible. Installing...", true);
|
||||
}
|
||||
finally {
|
||||
endGroup();
|
||||
}
|
||||
startGroup("📥 Installing Wrangler");
|
||||
try {
|
||||
await (0,exec.exec)(packageManager.install, [`wrangler@${config["WRANGLER_VERSION"]}`], {
|
||||
|
||||
Reference in New Issue
Block a user