Skip to content

Commit 926357f

Browse files
committed
Update index.ts
1 parent cb26947 commit 926357f

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

src/index.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ async function run(): Promise<void> {
4545
? workingDirectoryInput.trim()
4646
: undefined;
4747

48-
const wranglerCommandParts = wranglerCommandInput.trim().split(/\s+/);
49-
const wranglerExec = wranglerCommandParts[0];
50-
const wranglerBaseArgs = wranglerCommandParts.slice(1);
48+
const wranglerCommand = wranglerCommandInput.trim();
5149

5250
if (!apiToken) {
5351
core.setFailed("Cloudflare API token (api_token) is required.");
@@ -93,7 +91,6 @@ async function run(): Promise<void> {
9391
// We assume the user is on Wrangler v4+ and that `versions` commands are available.
9492
// The actual Worker configuration (e.g. wrangler.toml) is controlled by the caller.
9593
const uploadArgs = [
96-
...wranglerBaseArgs,
9794
"versions",
9895
"upload",
9996
"--config",
@@ -102,7 +99,7 @@ async function run(): Promise<void> {
10299
`--message=${renderedMessage}`,
103100
];
104101

105-
core.info(`Running: wrangler ${uploadArgs.join(" ")}`);
102+
core.info(`Running upload: ${wranglerCommand} ${uploadArgs.join(" ")}`);
106103

107104
let uploadStdout = "";
108105
let uploadStderr = "";
@@ -128,7 +125,7 @@ async function run(): Promise<void> {
128125
};
129126

130127
const uploadExitCode = await exec.exec(
131-
wranglerExec,
128+
wranglerCommand,
132129
uploadArgs,
133130
uploadOptions,
134131
);
@@ -172,7 +169,6 @@ async function run(): Promise<void> {
172169

173170
// 3) Run `wrangler versions deploy <versionId>` non-interactively with the same message.
174171
const deployArgs = [
175-
...wranglerBaseArgs,
176172
"versions",
177173
"deploy",
178174
versionId,
@@ -183,7 +179,7 @@ async function run(): Promise<void> {
183179
`--message=${renderedMessage}`,
184180
];
185181

186-
core.info(`Running: wrangler ${deployArgs.join(" ")}`);
182+
core.info(`Running deploy: ${wranglerCommand} ${deployArgs.join(" ")}`);
187183

188184
let deployStdout = "";
189185
let deployStderr = "";
@@ -209,7 +205,7 @@ async function run(): Promise<void> {
209205
};
210206

211207
const deployExitCode = await exec.exec(
212-
wranglerExec,
208+
wranglerCommand,
213209
deployArgs,
214210
deployOptions,
215211
);

0 commit comments

Comments
 (0)