Skip to content

Commit 84bacc4

Browse files
committed
Fixes.
1 parent 926357f commit 84bacc4

3 files changed

Lines changed: 11 additions & 140 deletions

File tree

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: "Deploy Cloudflare Workers/Pages using Wrangler v4 with customizabl
33
author: "neighbor"
44
branding:
55
icon: "cloud"
6-
color: "blue"
6+
color: "orange"
77

88
inputs:
99
api_token:
@@ -16,8 +16,8 @@ inputs:
1616
description: "Working directory from which Wrangler commands will be executed (useful for monorepos)."
1717
required: false
1818
config:
19-
description: "Path to the Wrangler configuration file (e.g. wrangler.toml or dist/server/wrangler.json). This will be passed as --config to both versions upload and versions deploy."
20-
required: true
19+
description: "Optional path to the Wrangler configuration file (e.g. wrangler.toml or dist/server/wrangler.json). When provided, this will be passed as --config to both versions upload and versions deploy. If omitted, Wrangler's default config resolution is used."
20+
required: false
2121
upload_args:
2222
description: "Additional arguments passed only to wrangler versions upload (excluding --config). Example: --env production"
2323
required: false

src/index.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ async function run(): Promise<void> {
9393
const uploadArgs = [
9494
"versions",
9595
"upload",
96-
"--config",
97-
config,
96+
...(config ? ["--config", config] : []),
9897
...uploadArgsList,
9998
`--message=${renderedMessage}`,
10099
];
@@ -119,7 +118,6 @@ async function run(): Promise<void> {
119118
stderr: (data: Buffer) => {
120119
const text = data.toString();
121120
uploadStderr += text;
122-
core.error(text.trimEnd());
123121
},
124122
},
125123
};
@@ -131,6 +129,9 @@ async function run(): Promise<void> {
131129
);
132130

133131
if (uploadExitCode !== 0) {
132+
if (uploadStderr.trim()) {
133+
core.error(uploadStderr.trimEnd());
134+
}
134135
core.setFailed(
135136
`wrangler versions upload failed with exit code ${uploadExitCode}. See logs above for details.`,
136137
);
@@ -173,8 +174,7 @@ async function run(): Promise<void> {
173174
"deploy",
174175
versionId,
175176
"-y",
176-
"--config",
177-
config,
177+
...(config ? ["--config", config] : []),
178178
...deployArgsList,
179179
`--message=${renderedMessage}`,
180180
];
@@ -199,7 +199,6 @@ async function run(): Promise<void> {
199199
stderr: (data: Buffer) => {
200200
const text = data.toString();
201201
deployStderr += text;
202-
core.error(text.trimEnd());
203202
},
204203
},
205204
};
@@ -211,6 +210,9 @@ async function run(): Promise<void> {
211210
);
212211

213212
if (deployExitCode !== 0) {
213+
if (deployStderr.trim()) {
214+
core.error(deployStderr.trimEnd());
215+
}
214216
core.setFailed(
215217
`wrangler versions deploy failed with exit code ${deployExitCode}. See logs above for details.`,
216218
);

src/metadata.ts

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

0 commit comments

Comments
 (0)