Skip to content

Commit 43767e7

Browse files
authored
Merge pull request #309 from cloudflare/maximo/revert-add-parity-with-pages-action
Revert add parity with pages action
2 parents c010357 + 10d5b9c commit 43767e7

File tree

6 files changed

+20
-232
lines changed

6 files changed

+20
-232
lines changed

.changeset/few-doors-relax.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler-action": minor
3+
---
4+
5+
Revert "Add parity with pages-action for pages deploy outputs"

package-lock.json

Lines changed: 3 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
},
3131
"dependencies": {
3232
"@actions/core": "^1.10.1",
33-
"@actions/exec": "^1.1.1",
34-
"zod": "^3.23.8"
33+
"@actions/exec": "^1.1.1"
3534
},
3635
"devDependencies": {
3736
"@changesets/changelog-github": "^0.4.8",
@@ -40,7 +39,6 @@
4039
"@types/node": "^20.10.4",
4140
"@vercel/ncc": "^0.38.1",
4241
"prettier": "^3.1.0",
43-
"mock-fs": "^5.4.0",
4442
"semver": "^7.5.4",
4543
"typescript": "^5.3.3",
4644
"vitest": "^1.0.3"

src/index.ts

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
import {
2-
debug,
32
getBooleanInput,
43
getInput,
54
getMultilineInput,
65
endGroup as originalEndGroup,
76
error as originalError,
87
info as originalInfo,
8+
debug,
99
startGroup as originalStartGroup,
1010
setFailed,
1111
setOutput,
1212
} from "@actions/core";
1313
import { getExecOutput } from "@actions/exec";
1414
import semverEq from "semver/functions/eq";
1515
import { exec, execShell } from "./exec";
16-
import { getPackageManager } from "./packageManagers";
1716
import { checkWorkingDirectory, semverCompare } from "./utils";
18-
import { getDetailedPagesDeployOutput } from "./wranglerArtifactManager";
17+
import { getPackageManager } from "./packageManagers";
1918

20-
const DEFAULT_WRANGLER_VERSION = "3.81.0";
19+
const DEFAULT_WRANGLER_VERSION = "3.78.10";
2120

2221
/**
2322
* A configuration object that contains all the inputs & immutable state for the action.
@@ -314,9 +313,6 @@ async function wranglerCommands() {
314313
let stdErr = "";
315314

316315
// Construct the options for the exec command
317-
const wranglerOutputDir = "/opt/wranglerArtifacts";
318-
process.env.WRANGLER_OUTPUT_FILE_DIRECTORY = wranglerOutputDir;
319-
320316
const options = {
321317
cwd: config["workingDirectory"],
322318
silent: config["QUIET_MODE"],
@@ -337,9 +333,14 @@ async function wranglerCommands() {
337333
setOutput("command-output", stdOut);
338334
setOutput("command-stderr", stdErr);
339335

340-
// Check if this command is a workers deployment
341-
if (command.startsWith("deploy") || command.startsWith("publish")) {
342-
// Try to extract the deployment URL
336+
// Check if this command is a workers or pages deployment
337+
if (
338+
command.startsWith("deploy") ||
339+
command.startsWith("publish") ||
340+
command.startsWith("pages publish") ||
341+
command.startsWith("pages deploy")
342+
) {
343+
// If this is a workers or pages deployment, try to extract the deployment URL
343344
let deploymentUrl = "";
344345
const deploymentUrlMatch = stdOut.match(/https?:\/\/[a-zA-Z0-9-./]+/);
345346
if (deploymentUrlMatch && deploymentUrlMatch[0]) {
@@ -356,26 +357,6 @@ async function wranglerCommands() {
356357
setOutput("deployment-alias-url", aliasUrl);
357358
}
358359
}
359-
// Check if this command is a pages deployment
360-
if (
361-
command.startsWith("pages publish") ||
362-
command.startsWith("pages deploy")
363-
) {
364-
const pagesArtifactFields =
365-
await getDetailedPagesDeployOutput(wranglerOutputDir);
366-
367-
if (pagesArtifactFields) {
368-
setOutput("id", pagesArtifactFields.deployment_id);
369-
setOutput("url", pagesArtifactFields.url);
370-
// To ensure parity with pages-action, display url for alias if there is no alias
371-
setOutput("alias", pagesArtifactFields.alias);
372-
setOutput("environment", pagesArtifactFields.environment);
373-
} else {
374-
info(
375-
"No fields available for output. Have you updated wrangler to version >=3.81.0?",
376-
);
377-
}
378-
}
379360
}
380361
} finally {
381362
endGroup();

src/wranglerArtifactManager.test.ts

Lines changed: 0 additions & 89 deletions
This file was deleted.

src/wranglerArtifactManager.ts

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)