Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

Commit 46e7cec

Browse files
authored
Add wranglerVersion options (#82)
1 parent 09ef98d commit 46e7cec

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ inputs:
2525
workingDirectory:
2626
description: "The working directory in which to run Wrangler"
2727
required: false
28+
wranglerVersion:
29+
description: "The version of Wrangler to use"
30+
required: false
31+
default: 2
2832
runs:
2933
using: "node16"
3034
main: "index.js"

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22069,6 +22069,7 @@ try {
2206922069
const gitHubToken = (0, import_core.getInput)("gitHubToken", { required: false });
2207022070
const branch = (0, import_core.getInput)("branch", { required: false });
2207122071
const workingDirectory = (0, import_core.getInput)("workingDirectory", { required: false });
22072+
const wranglerVersion = (0, import_core.getInput)("wranglerVersion", { required: false });
2207222073
const getProject = async () => {
2207322074
const response = await (0, import_undici.fetch)(
2207422075
`https://api.cloudflare.com/client/v4/accounts/${accountId}/pages/projects/${projectName}`,
@@ -22084,7 +22085,7 @@ try {
2208422085
$ export CLOUDFLARE_ACCOUNT_ID="${accountId}"
2208522086
}
2208622087

22087-
$$ npx wrangler@2 pages publish "${directory}" --project-name="${projectName}" --branch="${branch}"
22088+
$$ npx wrangler@${wranglerVersion} pages publish "${directory}" --project-name="${projectName}" --branch="${branch}"
2208822089
`;
2208922090
const response = await (0, import_undici.fetch)(
2209022091
`https://api.cloudflare.com/client/v4/accounts/${accountId}/pages/projects/${projectName}/deployments`,

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ try {
1616
const gitHubToken = getInput("gitHubToken", { required: false });
1717
const branch = getInput("branch", { required: false });
1818
const workingDirectory = getInput("workingDirectory", { required: false });
19+
const wranglerVersion = getInput("wranglerVersion", { required: false });
1920

2021
const getProject = async () => {
2122
const response = await fetch(
@@ -34,7 +35,7 @@ try {
3435
$ export CLOUDFLARE_ACCOUNT_ID="${accountId}"
3536
}
3637
37-
$$ npx wrangler@2 pages publish "${directory}" --project-name="${projectName}" --branch="${branch}"
38+
$$ npx wrangler@${wranglerVersion} pages publish "${directory}" --project-name="${projectName}" --branch="${branch}"
3839
`;
3940

4041
const response = await fetch(

0 commit comments

Comments
 (0)