Add wranglerVersion options (#82)

This commit is contained in:
perror 2023-05-21 16:14:37 +08:00 committed by GitHub
parent 09ef98de2f
commit 46e7ceca56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View file

@ -25,6 +25,10 @@ inputs:
workingDirectory:
description: "The working directory in which to run Wrangler"
required: false
wranglerVersion:
description: "The version of Wrangler to use"
required: false
default: 2
runs:
using: "node16"
main: "index.js"

View file

@ -22069,6 +22069,7 @@ try {
const gitHubToken = (0, import_core.getInput)("gitHubToken", { required: false });
const branch = (0, import_core.getInput)("branch", { required: false });
const workingDirectory = (0, import_core.getInput)("workingDirectory", { required: false });
const wranglerVersion = (0, import_core.getInput)("wranglerVersion", { required: false });
const getProject = async () => {
const response = await (0, import_undici.fetch)(
`https://api.cloudflare.com/client/v4/accounts/${accountId}/pages/projects/${projectName}`,
@ -22084,7 +22085,7 @@ try {
$ export CLOUDFLARE_ACCOUNT_ID="${accountId}"
}
$$ npx wrangler@2 pages publish "${directory}" --project-name="${projectName}" --branch="${branch}"
$$ npx wrangler@${wranglerVersion} pages publish "${directory}" --project-name="${projectName}" --branch="${branch}"
`;
const response = await (0, import_undici.fetch)(
`https://api.cloudflare.com/client/v4/accounts/${accountId}/pages/projects/${projectName}/deployments`,

View file

@ -16,6 +16,7 @@ try {
const gitHubToken = getInput("gitHubToken", { required: false });
const branch = getInput("branch", { required: false });
const workingDirectory = getInput("workingDirectory", { required: false });
const wranglerVersion = getInput("wranglerVersion", { required: false });
const getProject = async () => {
const response = await fetch(
@ -34,7 +35,7 @@ try {
$ export CLOUDFLARE_ACCOUNT_ID="${accountId}"
}
$$ npx wrangler@2 pages publish "${directory}" --project-name="${projectName}" --branch="${branch}"
$$ npx wrangler@${wranglerVersion} pages publish "${directory}" --project-name="${projectName}" --branch="${branch}"
`;
const response = await fetch(