diff --git a/.changeset/wild-tomatoes-return.md b/.changeset/wild-tomatoes-return.md
new file mode 100644
index 00000000..f41db071
--- /dev/null
+++ b/.changeset/wild-tomatoes-return.md
@@ -0,0 +1,5 @@
+---
+"github-actions-cloudflare-pages": patch
+---
+
+feat(deps): bump wrangler from 3.53.0 to 3.53.1
diff --git a/dist/deploy/index.js b/dist/deploy/index.js
index 715633fd..534b6783 100644
--- a/dist/deploy/index.js
+++ b/dist/deploy/index.js
@@ -60,7 +60,7 @@ ${pendingInterceptorsFormatter.format(pending)}
`).filter(x=>x!=="");return options&&options.trimWhitespace===!1?inputs:inputs.map(input=>input.trim())}__name(getMultilineInput,"getMultilineInput");exports.getMultilineInput=getMultilineInput;function getBooleanInput(name,options){let trueValue=["true","True","TRUE"],falseValue=["false","False","FALSE"],val=getInput3(name,options);if(trueValue.includes(val))return!0;if(falseValue.includes(val))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}__name(getBooleanInput,"getBooleanInput");exports.getBooleanInput=getBooleanInput;function setOutput2(name,value){if(process.env.GITHUB_OUTPUT||"")return file_command_1.issueFileCommand("OUTPUT",file_command_1.prepareKeyValueMessage(name,value));process.stdout.write(os.EOL),command_1.issueCommand("set-output",{name},utils_1.toCommandValue(value))}__name(setOutput2,"setOutput");exports.setOutput=setOutput2;function setCommandEcho(enabled){command_1.issue("echo",enabled?"on":"off")}__name(setCommandEcho,"setCommandEcho");exports.setCommandEcho=setCommandEcho;function setFailed4(message){process.exitCode=ExitCode.Failure,error2(message)}__name(setFailed4,"setFailed");exports.setFailed=setFailed4;function isDebug3(){return process.env.RUNNER_DEBUG==="1"}__name(isDebug3,"isDebug");exports.isDebug=isDebug3;function debug4(message){command_1.issueCommand("debug",{},message)}__name(debug4,"debug");exports.debug=debug4;function error2(message,properties={}){command_1.issueCommand("error",utils_1.toCommandProperties(properties),message instanceof Error?message.toString():message)}__name(error2,"error");exports.error=error2;function warning(message,properties={}){command_1.issueCommand("warning",utils_1.toCommandProperties(properties),message instanceof Error?message.toString():message)}__name(warning,"warning");exports.warning=warning;function notice2(message,properties={}){command_1.issueCommand("notice",utils_1.toCommandProperties(properties),message instanceof Error?message.toString():message)}__name(notice2,"notice");exports.notice=notice2;function info2(message){process.stdout.write(message+os.EOL)}__name(info2,"info");exports.info=info2;function startGroup(name){command_1.issue("group",name)}__name(startGroup,"startGroup");exports.startGroup=startGroup;function endGroup(){command_1.issue("endgroup")}__name(endGroup,"endGroup");exports.endGroup=endGroup;function group(name,fn){return __awaiter(this,void 0,void 0,function*(){startGroup(name);let result;try{result=yield fn()}finally{endGroup()}return result})}__name(group,"group");exports.group=group;function saveState(name,value){if(process.env.GITHUB_STATE||"")return file_command_1.issueFileCommand("STATE",file_command_1.prepareKeyValueMessage(name,value));command_1.issueCommand("save-state",{name},utils_1.toCommandValue(value))}__name(saveState,"saveState");exports.saveState=saveState;function getState(name){return process.env[`STATE_${name}`]||""}__name(getState,"getState");exports.getState=getState;function getIDToken(aud){return __awaiter(this,void 0,void 0,function*(){return yield oidc_utils_1.OidcClient.getIDToken(aud)})}__name(getIDToken,"getIDToken");exports.getIDToken=getIDToken;var summary_1=require_summary();Object.defineProperty(exports,"summary",{enumerable:!0,get:function(){return summary_1.summary}});var summary_2=require_summary();Object.defineProperty(exports,"markdownSummary",{enumerable:!0,get:function(){return summary_2.markdownSummary}});var path_utils_1=require_path_utils();Object.defineProperty(exports,"toPosixPath",{enumerable:!0,get:function(){return path_utils_1.toPosixPath}});Object.defineProperty(exports,"toWin32Path",{enumerable:!0,get:function(){return path_utils_1.toWin32Path}});Object.defineProperty(exports,"toPlatformPath",{enumerable:!0,get:function(){return path_utils_1.toPlatformPath}})}});var import_core11=__toESM(require_core(),1);var import_core10=__toESM(require_core(),1);var import_core7=__toESM(require_core(),1);import{strict}from"node:assert";var import_core3=__toESM(require_core(),1);var import_core=__toESM(require_core(),1);import{exec}from"node:child_process";import{existsSync}from"node:fs";import path from"node:path";import{promisify}from"node:util";var raise=__name(message=>{throw new Error(message)},"raise"),raiseFail=__name(message=>{throw(0,import_core.setFailed)(message),new Error(message)},"raiseFail"),execAsync=promisify(exec),checkWorkingDirectory=__name((directory=".")=>{let p=path.normalize(directory);if(existsSync(p))return p;throw new Error(`Directory not found: ${directory}`)},"checkWorkingDirectory");var import_core2=__toESM(require_core(),1);import{strict as assert}from"node:assert";import{existsSync as existsSync2,readFileSync}from"node:fs";import{EOL}from"node:os";var EVENT_NAMES=["branch_protection_configuration","branch_protection_rule","check_run","check_suite","code_scanning_alert","commit_comment","create","custom_property","custom_property_values","delete","dependabot_alert","deploy_key","deployment","deployment_protection_rule","deployment_review","deployment_status","discussion","discussion_comment","fork","github_app_authorization","gollum","installation","installation_repositories","installation_target","issue_comment","issues","label","marketplace_purchase","member","membership","merge_group","meta","milestone","org_block","organization","package","page_build","ping","project","project_card","project_column","projects_v2_item","public","pull_request","pull_request_review","pull_request_review_comment","pull_request_review_thread","push","registry_package","release","repository","repository_dispatch","repository_import","repository_vulnerability_alert","secret_scanning_alert","secret_scanning_alert_location","security_advisory","sponsorship","star","status","team","team_add","watch","workflow_dispatch","workflow_job","workflow_run"];var getPayload=__name(()=>{if(process.env.GITHUB_EVENT_PATH){if(existsSync2(process.env.GITHUB_EVENT_PATH))return JSON.parse(readFileSync(process.env.GITHUB_EVENT_PATH,{encoding:"utf8"}));{let path2=process.env.GITHUB_EVENT_PATH;process.stdout.write(`GITHUB_EVENT_PATH ${path2} does not exist${EOL}`)}}},"getPayload"),getWorkflowEvent=__name(()=>{let eventName=process.env.GITHUB_EVENT_NAME;assert(EVENT_NAMES.includes(eventName),`eventName ${eventName} is not supported`);let payload=getPayload();return(0,import_core2.isDebug)()&&((0,import_core2.debug)(`eventName: ${eventName}`),(0,import_core2.debug)(`payload: ${JSON.stringify(payload)}`)),{eventName,payload}},"getWorkflowEvent");var getGitHubContext=__name(()=>{let event=getWorkflowEvent(),repo=(()=>{let[owner,repo2]=process.env.GITHUB_REPOSITORY?process.env.GITHUB_REPOSITORY.split("/"):raise("context.repo: requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"),node_id="repository"in event.payload?event.payload.repository?.node_id||raise("context.repo: no repo node_id in payload"):raise("context.repo: no repo node_id in payload");return{owner,repo:repo2,node_id}})(),branch=process.env.GITHUB_HEAD_REF||process.env.GITHUB_REF_NAME,sha=process.env.GITHUB_SHA,graphqlEndpoint=process.env.GITHUB_GRAPHQL_URL,ref=(()=>{let ref2=process.env.GITHUB_HEAD_REF;return!ref2&&("ref"in event.payload?ref2=event.payload.ref:event.eventName==="pull_request"&&(ref2=event.payload.pull_request.head.ref),!ref2)?raise("context: no ref"):ref2})(),context={event,repo,branch,sha,graphqlEndpoint,ref};if((0,import_core3.isDebug)()){let debugContext={...context,event:"will debug itself as output is large"};(0,import_core3.debug)(`context: ${JSON.stringify(debugContext)}`)}return context},"getGitHubContext"),_context,useContext=__name(()=>_context??(_context=getGitHubContext()),"useContext"),useContextEvent=__name(()=>useContext().event,"useContextEvent");var import_core4=__toESM(require_core(),1);var INPUT_KEY_CLOUDFLARE_ACCOUNT_ID="cloudflare-account-id",INPUT_KEY_CLOUDFLARE_API_TOKEN="cloudflare-api-token",INPUT_KEY_CLOUDFLARE_PROJECT_NAME="cloudflare-project-name",INPUT_KEY_DIRECTORY="directory",INPUT_KEY_GITHUB_ENVIRONMENT="github-environment",INPUT_KEY_GITHUB_TOKEN="github-token",INPUT_KEY_WORKING_DIRECTORY="working-directory";var getInputs=__name(()=>({cloudflareApiToken:(0,import_core4.getInput)(INPUT_KEY_CLOUDFLARE_API_TOKEN,{required:!0}),gitHubApiToken:(0,import_core4.getInput)(INPUT_KEY_GITHUB_TOKEN,{required:!0}),gitHubEnvironment:(0,import_core4.getInput)(INPUT_KEY_GITHUB_ENVIRONMENT,{required:!1})||void 0}),"getInputs"),_inputs,useCommonInputs=__name(()=>_inputs??(_inputs=getInputs()),"useCommonInputs");var API_ENDPOINT="https://api.cloudflare.com",getCloudflareApiEndpoint=__name(({path:path2,accountId,projectName})=>{let input=[`/client/v4/accounts/${accountId}/pages/projects/${projectName}`,path2].filter(Boolean).join("/");return new URL(input,API_ENDPOINT).toString()},"getCloudflareApiEndpoint"),getCloudflareLogEndpoint=__name(({id,accountId,projectName})=>new URL(`${accountId}/pages/view/${projectName}/${id}`,"https://dash.cloudflare.com").toString(),"getCloudflareLogEndpoint");var import_core5=__toESM(require_core(),1);var ParseError=class extends Error{static{__name(this,"ParseError")}text;notes;location;kind;code;constructor({text,notes,location,kind}){super(text),this.name=this.constructor.name,this.text=text,this.notes=notes??[],this.location=location,this.kind=kind??"error"}};var throwFetchError=__name((resource,response)=>{let error2=new ParseError({text:`A request to the Cloudflare API (${resource}) failed.`,notes:response.errors.map(err=>({text:renderError(err)}))}),code=response.errors[0]?.code;throw code&&(error2.code=code),error2.notes?.length>0&&error2.notes.map(note=>{(0,import_core5.error)(`Cloudflare API: ${note.text}`)}),error2},"throwFetchError"),renderError=__name((err,level=0)=>{let chainedMessages=err.error_chain?.map(chainedError=>`
${" ".repeat(level)}- ${renderError(chainedError,level+1)}`).join(`
-`)??"";return(err.code?`${err.message} [code: ${err.code}]`:err.message)+chainedMessages},"renderError");var fetchResult=__name(async(resource,init={},queryParams,abortSignal)=>{let method=init.method??"GET",{cloudflareApiToken}=useCommonInputs(),initFetch={headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${cloudflareApiToken}`}},response=await fetch(resource,{method,...initFetch,signal:abortSignal}).then(response2=>response2.json());if(response.success){if(response.result===null||response.result===void 0)throw new Error("Cloudflare API: response missing 'result'");return response.result}return throwFetchError(resource,response)},"fetchResult");var getCloudflareDeploymentAlias=__name(deployment=>deployment.aliases&&deployment.aliases.length>0?deployment.aliases[0]:deployment.url,"getCloudflareDeploymentAlias"),getCloudflareLatestDeployment=__name(async({accountId,projectName})=>{let{sha:commitHash}=useContext(),deployment=(await fetchResult(getCloudflareApiEndpoint({path:"deployments",accountId,projectName})))?.find(deployment2=>deployment2.deployment_trigger.metadata.commit_hash===commitHash);if(deployment===void 0)throw new Error(`Cloudflare: could not find deployment with commitHash: ${commitHash}`);return deployment},"getCloudflareLatestDeployment");var import_core6=__toESM(require_core(),1);var ERROR_KEY="Status Of Deployment:",statusCloudflareDeployment=__name(async apiEndpoint=>{let deploymentStatus="unknown",deployment;do try{deployment=await getCloudflareLatestDeployment(apiEndpoint);let deployStage=deployment.stages.find(stage=>stage.name==="deploy");switch((0,import_core6.debug)(JSON.stringify(deployStage)),deployStage?.status){case"active":case"success":case"failure":case"skipped":case"canceled":{deploymentStatus=deployStage.status;break}default:await new Promise(resolve=>setTimeout(resolve,1e3))}}catch(error2){throw error2 instanceof Error?error2:error2&&typeof error2=="object"&&"stderr"in error2&&typeof error2.stderr=="string"?new Error(error2.stderr):new Error(`${ERROR_KEY} unknown error`)}while(deploymentStatus==="unknown");return{deployment,status:deploymentStatus}},"statusCloudflareDeployment");var CLOUDFLARE_API_TOKEN="CLOUDFLARE_API_TOKEN",CLOUDFLARE_ACCOUNT_ID="CLOUDFLARE_ACCOUNT_ID",ERROR_KEY2="Create Deployment:",createCloudflareDeployment=__name(async({accountId,projectName,directory,workingDirectory=""})=>{let{cloudflareApiToken}=useCommonInputs();process.env[CLOUDFLARE_API_TOKEN]=cloudflareApiToken,process.env[CLOUDFLARE_ACCOUNT_ID]=accountId;let{repo,branch,sha:commitHash}=useContext();if(branch===void 0)throw new Error(`${ERROR_KEY2} branch is undefined`);try{let WRANGLER_VERSION="3.53.0";strict(WRANGLER_VERSION,"wrangler version should exist");let{stdout}=await execAsync(`npx wrangler@${WRANGLER_VERSION} pages deploy ${directory} --project-name=${projectName} --branch=${branch} --commit-dirty=true --commit-hash=${commitHash}`,{env:process.env,cwd:workingDirectory});(0,import_core7.info)(stdout);let{deployment,status}=await statusCloudflareDeployment({accountId,projectName});(0,import_core7.setOutput)("id",deployment.id),(0,import_core7.setOutput)("url",deployment.url),(0,import_core7.setOutput)("environment",deployment.environment);let alias=getCloudflareDeploymentAlias(deployment);return(0,import_core7.setOutput)("alias",alias),(0,import_core7.setOutput)("wrangler",stdout),await import_core7.summary.addHeading("Cloudflare Pages Deployment").addBreak().addTable([[{data:"Name",header:!0},{data:"Result",header:!0}],["Environment:",deployment.environment],["Branch:",`${deployment.deployment_trigger.metadata.branch}
`],["Commit Hash:",`${deployment.deployment_trigger.metadata.commit_hash}
`],["Commit Message:",deployment.deployment_trigger.metadata.commit_message],["Status:",`${status.toUpperCase()||"UNKNOWN"}`],["Preview URL:",`${deployment.url}`],["Branch Preview URL:",`${alias}`],["Wrangler Output:",`${stdout}`]]).write(),{deployment,wranglerOutput:stdout}}catch(error2){throw error2 instanceof Error?error2:error2&&typeof error2=="object"&&"stderr"in error2&&typeof error2.stderr=="string"?new Error(error2.stderr):new Error(`${ERROR_KEY2} unknown error`)}},"createCloudflareDeployment");var TypedDocumentString=class extends String{constructor(value,__meta__){super(value);this.value=value;this.__meta__=__meta__}static{__name(this,"TypedDocumentString")}__apiType;toString(){return this.value}},DeploymentFragmentFragmentDoc=new TypedDocumentString(`
+`)??"";return(err.code?`${err.message} [code: ${err.code}]`:err.message)+chainedMessages},"renderError");var fetchResult=__name(async(resource,init={},queryParams,abortSignal)=>{let method=init.method??"GET",{cloudflareApiToken}=useCommonInputs(),initFetch={headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${cloudflareApiToken}`}},response=await fetch(resource,{method,...initFetch,signal:abortSignal}).then(response2=>response2.json());if(response.success){if(response.result===null||response.result===void 0)throw new Error("Cloudflare API: response missing 'result'");return response.result}return throwFetchError(resource,response)},"fetchResult");var getCloudflareDeploymentAlias=__name(deployment=>deployment.aliases&&deployment.aliases.length>0?deployment.aliases[0]:deployment.url,"getCloudflareDeploymentAlias"),getCloudflareLatestDeployment=__name(async({accountId,projectName})=>{let{sha:commitHash}=useContext(),deployment=(await fetchResult(getCloudflareApiEndpoint({path:"deployments",accountId,projectName})))?.find(deployment2=>deployment2.deployment_trigger.metadata.commit_hash===commitHash);if(deployment===void 0)throw new Error(`Cloudflare: could not find deployment with commitHash: ${commitHash}`);return deployment},"getCloudflareLatestDeployment");var import_core6=__toESM(require_core(),1);var ERROR_KEY="Status Of Deployment:",statusCloudflareDeployment=__name(async apiEndpoint=>{let deploymentStatus="unknown",deployment;do try{deployment=await getCloudflareLatestDeployment(apiEndpoint);let deployStage=deployment.stages.find(stage=>stage.name==="deploy");switch((0,import_core6.debug)(JSON.stringify(deployStage)),deployStage?.status){case"active":case"success":case"failure":case"skipped":case"canceled":{deploymentStatus=deployStage.status;break}default:await new Promise(resolve=>setTimeout(resolve,1e3))}}catch(error2){throw error2 instanceof Error?error2:error2&&typeof error2=="object"&&"stderr"in error2&&typeof error2.stderr=="string"?new Error(error2.stderr):new Error(`${ERROR_KEY} unknown error`)}while(deploymentStatus==="unknown");return{deployment,status:deploymentStatus}},"statusCloudflareDeployment");var CLOUDFLARE_API_TOKEN="CLOUDFLARE_API_TOKEN",CLOUDFLARE_ACCOUNT_ID="CLOUDFLARE_ACCOUNT_ID",ERROR_KEY2="Create Deployment:",createCloudflareDeployment=__name(async({accountId,projectName,directory,workingDirectory=""})=>{let{cloudflareApiToken}=useCommonInputs();process.env[CLOUDFLARE_API_TOKEN]=cloudflareApiToken,process.env[CLOUDFLARE_ACCOUNT_ID]=accountId;let{repo,branch,sha:commitHash}=useContext();if(branch===void 0)throw new Error(`${ERROR_KEY2} branch is undefined`);try{let WRANGLER_VERSION="3.53.1";strict(WRANGLER_VERSION,"wrangler version should exist");let{stdout}=await execAsync(`npx wrangler@${WRANGLER_VERSION} pages deploy ${directory} --project-name=${projectName} --branch=${branch} --commit-dirty=true --commit-hash=${commitHash}`,{env:process.env,cwd:workingDirectory});(0,import_core7.info)(stdout);let{deployment,status}=await statusCloudflareDeployment({accountId,projectName});(0,import_core7.setOutput)("id",deployment.id),(0,import_core7.setOutput)("url",deployment.url),(0,import_core7.setOutput)("environment",deployment.environment);let alias=getCloudflareDeploymentAlias(deployment);return(0,import_core7.setOutput)("alias",alias),(0,import_core7.setOutput)("wrangler",stdout),await import_core7.summary.addHeading("Cloudflare Pages Deployment").addBreak().addTable([[{data:"Name",header:!0},{data:"Result",header:!0}],["Environment:",deployment.environment],["Branch:",`${deployment.deployment_trigger.metadata.branch}
`],["Commit Hash:",`${deployment.deployment_trigger.metadata.commit_hash}
`],["Commit Message:",deployment.deployment_trigger.metadata.commit_message],["Status:",`${status.toUpperCase()||"UNKNOWN"}`],["Preview URL:",`${deployment.url}`],["Branch Preview URL:",`${alias}`],["Wrangler Output:",`${stdout}`]]).write(),{deployment,wranglerOutput:stdout}}catch(error2){throw error2 instanceof Error?error2:error2&&typeof error2=="object"&&"stderr"in error2&&typeof error2.stderr=="string"?new Error(error2.stderr):new Error(`${ERROR_KEY2} unknown error`)}},"createCloudflareDeployment");var TypedDocumentString=class extends String{constructor(value,__meta__){super(value);this.value=value;this.__meta__=__meta__}static{__name(this,"TypedDocumentString")}__apiType;toString(){return this.value}},DeploymentFragmentFragmentDoc=new TypedDocumentString(`
fragment DeploymentFragment on Deployment {
id
environment
diff --git a/package.json b/package.json
index 634bde1e..e26b70c8 100644
--- a/package.json
+++ b/package.json
@@ -49,7 +49,7 @@
"@actions/core": "1.10.1",
"@octokit-next/core": "2.8.0",
"@octokit/plugin-paginate-rest": "11.3.0",
- "wrangler": "3.53.0"
+ "wrangler": "3.53.1"
},
"devDependencies": {
"@changesets/changelog-github": "0.5.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 2bc8d0cf..2f6a7e71 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -18,8 +18,8 @@ importers:
specifier: 11.3.0
version: 11.3.0(@octokit/core@6.1.2)
wrangler:
- specifier: 3.53.0
- version: 3.53.0
+ specifier: 3.53.1
+ version: 3.53.1
devDependencies:
'@changesets/changelog-github':
specifier: 0.5.0
@@ -3805,8 +3805,8 @@ packages:
engines: {node: '>=16'}
hasBin: true
- wrangler@3.53.0:
- resolution: {integrity: sha512-JxkvCQekL9j8Mu4CEKM/HEVyDnymWzKQuMUuJH0yum1AilutD5HAP9kVVYmvu7BvwlRyRUAj8TI5OUxXnLCEpQ==}
+ wrangler@3.53.1:
+ resolution: {integrity: sha512-bdMRQdHYdvowIwOhEMFkARIZUh56aDw7HLUZ/2JreBjj760osXE4Fc4L1TCkfRRBWgB6/LKF5LA4OcvORMYmHg==}
engines: {node: '>=16.17.0'}
hasBin: true
peerDependencies:
@@ -3904,8 +3904,8 @@ packages:
youch@3.3.3:
resolution: {integrity: sha512-qSFXUk3UZBLfggAW3dJKg0BMblG5biqSF8M34E06o5CSsZtH92u9Hqmj2RzGiHDi64fhe83+4tENFP2DB6t6ZA==}
- zod@3.23.5:
- resolution: {integrity: sha512-fkwiq0VIQTksNNA131rDOsVJcns0pfVUjHzLrNBiF/O/Xxb5lQyEXkhZWcJ7npWsYlvs+h0jFWXXy4X46Em1JA==}
+ zod@3.23.6:
+ resolution: {integrity: sha512-RTHJlZhsRbuA8Hmp/iNL7jnfc4nZishjsanDAfEY1QpDQZCahUp3xDzl+zfweE9BklxMUcgBgS1b7Lvie/ZVwA==}
snapshots:
@@ -7098,7 +7098,7 @@ snapshots:
workerd: 1.20240419.0
ws: 8.17.0
youch: 3.3.3
- zod: 3.23.5
+ zod: 3.23.6
transitivePeerDependencies:
- bufferutil
- supports-color
@@ -8075,7 +8075,7 @@ snapshots:
'@cloudflare/workerd-linux-arm64': 1.20240419.0
'@cloudflare/workerd-windows-64': 1.20240419.0
- wrangler@3.53.0:
+ wrangler@3.53.1:
dependencies:
'@cloudflare/kv-asset-handler': 0.3.2
'@esbuild-plugins/node-globals-polyfill': 0.2.3(esbuild@0.17.19)
@@ -8173,4 +8173,4 @@ snapshots:
mustache: 4.2.0
stacktracey: 2.1.8
- zod@3.23.5: {}
+ zod@3.23.6: {}