From b3df63cd4218f5f29aa73db46cfa0fb1c5a14e7d Mon Sep 17 00:00:00 2001
From: Andy Kenward <4893048+andykenward@users.noreply.github.com>
Date: Sun, 10 Mar 2024 20:41:16 +0000
Subject: [PATCH 01/12] feat: wrangler logs
---
dist/index.js | 2 +-
dist/index.js.map | 4 ++--
src/cloudflare/deployment/create.ts | 8 ++++++--
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/dist/index.js b/dist/index.js
index 1e417a25..110ad962 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -3,7 +3,7 @@ var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,
`,"%0A")}__name(escapeData,"escapeData");__name3(escapeData,"escapeData");function escapeProperty(s){return toCommandValue(s).replaceAll("%","%25").replaceAll("\r","%0D").replaceAll(`
`,"%0A").replaceAll(":","%3A").replaceAll(",","%2C")}__name(escapeProperty,"escapeProperty");__name3(escapeProperty,"escapeProperty");import{randomUUID as uuidv4}from"node:crypto";import{appendFileSync,existsSync}from"node:fs";import{EOL as EOL2}from"node:os";var __defProp4=Object.defineProperty,__name4=__name((target,value)=>__defProp4(target,"name",{value,configurable:!0}),"__name"),issueFileCommand=__name4((command,message)=>{let filePath=process.env[`GITHUB_${command}`];if(!filePath)throw new Error(`Unable to find environment variable for file command ${command}`);if(!existsSync(filePath))throw new Error(`Missing file at path: ${filePath}`);appendFileSync(filePath,`${toCommandValue(message)}${EOL2}`,{encoding:"utf8"})},"issueFileCommand"),prepareKeyValueMessage=__name4((key,value)=>{let delimiter=`ghadelimiter_${uuidv4()}`,convertedValue=toCommandValue(value);if(key.includes(delimiter))throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);if(convertedValue.includes(delimiter))throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);return`${key}<<${delimiter}${EOL2}${convertedValue}${EOL2}${delimiter}`},"prepareKeyValueMessage");var __defProp5=Object.defineProperty,__name5=__name((target,value)=>__defProp5(target,"name",{value,configurable:!0}),"__name");var getInput=__name5((name,options)=>{let val=process.env[`INPUT_${name.replaceAll(" ","_").toUpperCase()}`]||"";if(options&&options.required&&!val)throw new Error(`Input required and not supplied: ${name}`);return options&&options.trimWhitespace===!1?val:val.trim()},"getInput");var setOutput=__name5((name,value)=>{if(process.env.GITHUB_OUTPUT||"")return issueFileCommand("OUTPUT",prepareKeyValueMessage(name,value));process.stdout.write(EOL3),issueCommand("set-output",{name},toCommandValue(value))},"setOutput");var ExitCode=(ExitCode2=>(ExitCode2[ExitCode2.Success=0]="Success",ExitCode2[ExitCode2.Failure=1]="Failure",ExitCode2))(ExitCode||{});var __defProp6=Object.defineProperty,__name6=__name((target,value)=>__defProp6(target,"name",{value,configurable:!0}),"__name"),error=__name6((message,properties={})=>{issueCommand("error",toCommandProperties(properties),message instanceof Error?message.toString():message)},"error"),setFailed=__name6(message=>{process.exitCode=ExitCode.Failure,error(message)},"setFailed");import{EOL as EOL4}from"node:os";var __defProp7=Object.defineProperty,__name7=__name((target,value)=>__defProp7(target,"name",{value,configurable:!0}),"__name"),isDebug=__name7(()=>process.env.RUNNER_DEBUG==="1","isDebug"),debug=__name7(message=>{issueCommand("debug",{},message)},"debug"),warning=__name7((message,properties={})=>{issueCommand("warning",toCommandProperties(properties),message instanceof Error?message.toString():message)},"warning");var info=__name7(message=>{process.stdout.write(message+EOL4)},"info");import{constants,promises}from"node:fs";import{EOL as EOL5}from"node:os";var __defProp8=Object.defineProperty,__name8=__name((target,value)=>__defProp8(target,"name",{value,configurable:!0}),"__name"),{access,appendFile,writeFile}=promises,SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";var Summary=class{static{__name(this,"Summary")}static{__name8(this,"Summary")}#buffer;#filePath;constructor(){this.#buffer=""}async#fileSummaryPath(){if(this.#filePath)return this.#filePath;let pathFromEnv=process.env[SUMMARY_ENV_VAR];if(!pathFromEnv)throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{await access(pathFromEnv,constants.R_OK|constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`)}return this.#filePath=pathFromEnv,this.#filePath}#wrap(tag,content,attrs={}){let htmlAttrs=Object.entries(attrs).map(([key,value])=>` ${key}="${value}"`).join("");return content?`<${tag}${htmlAttrs}>${content}${tag}>`:`<${tag}${htmlAttrs}>`}async write(options){let overwrite=!!options?.overwrite,filePath=await this.#fileSummaryPath();return await(overwrite?writeFile:appendFile)(filePath,this.#buffer,{encoding:"utf8"}),this.emptyBuffer()}async clear(){return this.emptyBuffer().write({overwrite:!0})}stringify(){return this.#buffer}isEmptyBuffer(){return this.#buffer.length===0}emptyBuffer(){return this.#buffer="",this}addRaw(text,addEOL=!1){return this.#buffer+=text,addEOL?this.addEOL():this}addEOL(){return this.addRaw(EOL5)}addCodeBlock(code,lang){let attrs={...lang&&{lang}},element=this.#wrap("pre",this.#wrap("code",code),attrs);return this.addRaw(element).addEOL()}addList(items,ordered=!1){let tag=ordered?"ol":"ul",listItems=items.map(item=>this.#wrap("li",item)).join(""),element=this.#wrap(tag,listItems);return this.addRaw(element).addEOL()}addTable(rows){let tableBody=rows.map(row=>{let cells=row.map(cell=>{if(typeof cell=="string")return this.#wrap("td",cell);let{header,data,colspan,rowspan}=cell,tag=header?"th":"td",attrs={...colspan&&{colspan},...rowspan&&{rowspan}};return this.#wrap(tag,data,attrs)}).join("");return this.#wrap("tr",cells)}).join(""),element=this.#wrap("table",tableBody);return this.addRaw(element).addEOL()}addDetails(label,content){let element=this.#wrap("details",this.#wrap("summary",label)+content);return this.addRaw(element).addEOL()}addImage(src,alt,options){let{width,height}=options||{},attrs={...width&&{width},...height&&{height}},element=this.#wrap("img",null,{src,alt,...attrs});return this.addRaw(element).addEOL()}addHeading(text,level){let tag=`h${level}`,allowedTag=["h1","h2","h3","h4","h5","h6"].includes(tag)?tag:"h1",element=this.#wrap(allowedTag,text);return this.addRaw(element).addEOL()}addSeparator(){let element=this.#wrap("hr",null);return this.addRaw(element).addEOL()}addBreak(){let element=this.#wrap("br",null);return this.addRaw(element).addEOL()}addQuote(text,cite){let attrs={...cite&&{cite}},element=this.#wrap("blockquote",text,attrs);return this.addRaw(element).addEOL()}addLink(text,href){let element=this.#wrap("a",text,{href});return this.addRaw(element).addEOL()}},_summary=new Summary,summary=_summary;import{strict}from"node:assert";import{exec}from"node:child_process";import{promisify}from"node:util";var raise=__name(message=>{throw new Error(message)},"raise"),raiseFail=__name(message=>{throw setFailed(message),new Error(message)},"raiseFail"),execAsync=promisify(exec);import{strict as assert}from"node:assert";import{existsSync as existsSync2,readFileSync}from"node:fs";import{EOL as EOL6}from"node:os";var EVENT_NAMES=["branch_protection_rule","check_run","check_suite","code_scanning_alert","commit_comment","create","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 path=process.env.GITHUB_EVENT_PATH;process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${EOL6}`)}}},"getPayload"),getWorkflowEvent=__name(()=>{let eventName=process.env.GITHUB_EVENT_NAME;assert(EVENT_NAMES.includes(eventName),`eventName ${eventName} is not supported`);let payload=getPayload();return isDebug()&&(debug(`eventName: ${eventName}`),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(isDebug()){let debugContext={...context,event:"will debug itself as output is large"};debug(`context: ${JSON.stringify(debugContext)}`)}return context},"getGitHubContext"),_context,useContext=__name(()=>_context??(_context=getGitHubContext()),"useContext"),useContextEvent=__name(()=>useContext().event,"useContextEvent");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";var OPTIONS={required:!0},getInputs=__name(()=>({cloudflareAccountId:getInput(INPUT_KEY_CLOUDFLARE_ACCOUNT_ID,OPTIONS),cloudflareApiToken:getInput(INPUT_KEY_CLOUDFLARE_API_TOKEN,OPTIONS),cloudflareProjectName:getInput(INPUT_KEY_CLOUDFLARE_PROJECT_NAME,OPTIONS),directory:getInput(INPUT_KEY_DIRECTORY,OPTIONS),gitHubApiToken:getInput(INPUT_KEY_GITHUB_TOKEN,OPTIONS),gitHubEnvironment:getInput(INPUT_KEY_GITHUB_ENVIRONMENT,OPTIONS)}),"getInputs"),_inputs,useInputs=__name(()=>_inputs??(_inputs=getInputs()),"useInputs");var API_ENDPOINT="https://api.cloudflare.com",getCloudflareApiEndpoint=__name(path=>{let{cloudflareAccountId,cloudflareProjectName}=useInputs(),input=[`/client/v4/accounts/${cloudflareAccountId}/pages/projects/${cloudflareProjectName}`,path].filter(Boolean).join("/");return new URL(input,API_ENDPOINT).toString()},"getCloudflareApiEndpoint"),getCloudflareLogEndpoint=__name(id=>{let{cloudflareAccountId,cloudflareProjectName}=useInputs();return new URL(`${cloudflareAccountId}/pages/view/${cloudflareProjectName}/${id}`,"https://dash.cloudflare.com").toString()},"getCloudflareLogEndpoint");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=>{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}=useInputs(),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"),fetchSuccess=__name(async(resource,init={})=>{let method=init.method??"GET",{cloudflareApiToken}=useInputs(),initFetch={headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${cloudflareApiToken}`}},response=await fetch(resource,{method,...initFetch}).then(response2=>response2.json());return!response.success&&response.errors.length>0&&throwFetchError(resource,response),response.success},"fetchSuccess");var getCloudflareDeployments=__name(async()=>{let url=getCloudflareApiEndpoint("deployments");return await fetchResult(url)},"getCloudflareDeployments"),getCloudflareDeploymentAlias=__name(deployment=>deployment.aliases&&deployment.aliases.length>0?deployment.aliases[0]:deployment.url,"getCloudflareDeploymentAlias"),getCloudflareLatestDeployment=__name(async()=>{let{sha:commitHash}=useContext(),deployment=(await getCloudflareDeployments())?.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 ERROR_KEY="Status Of Deployment:",statusCloudflareDeployment=__name(async()=>{let deploymentStatus="unknown",deployment;do try{deployment=await getCloudflareLatestDeployment();let deployStage=deployment.stages.find(stage=>stage.name==="deploy");switch(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()=>{let{cloudflareAccountId,cloudflareProjectName,directory,cloudflareApiToken}=useInputs();process.env[CLOUDFLARE_API_TOKEN]=cloudflareApiToken,process.env[CLOUDFLARE_ACCOUNT_ID]=cloudflareAccountId;let{repo,branch,sha:commitHash}=useContext();if(branch===void 0)throw new Error(`${ERROR_KEY2} branch is undefined`);try{let WRANGLER_VERSION="3.28.1";strict(WRANGLER_VERSION,"wrangler version should exist"),await execAsync(`npx wrangler@${WRANGLER_VERSION} pages deploy ${directory} --project-name=${cloudflareProjectName} --branch=${branch} --commit-dirty=true --commit-hash=${commitHash}`,{env:process.env});let{deployment,status}=await statusCloudflareDeployment();setOutput("id",deployment.id),setOutput("url",deployment.url),setOutput("environment",deployment.environment);let alias=getCloudflareDeploymentAlias(deployment);return setOutput("alias",alias),await summary.addHeading("Cloudflare Pages Deployment").write(),await summary.addBreak().write(),await summary.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}`]]).write(),deployment}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 getCloudflareProject=__name(async()=>{let url=getCloudflareApiEndpoint();return await fetchResult(url)},"getCloudflareProject");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}=useInputs(),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"),fetchSuccess=__name(async(resource,init={})=>{let method=init.method??"GET",{cloudflareApiToken}=useInputs(),initFetch={headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${cloudflareApiToken}`}},response=await fetch(resource,{method,...initFetch}).then(response2=>response2.json());return!response.success&&response.errors.length>0&&throwFetchError(resource,response),response.success},"fetchSuccess");var getCloudflareDeployments=__name(async()=>{let url=getCloudflareApiEndpoint("deployments");return await fetchResult(url)},"getCloudflareDeployments"),getCloudflareDeploymentAlias=__name(deployment=>deployment.aliases&&deployment.aliases.length>0?deployment.aliases[0]:deployment.url,"getCloudflareDeploymentAlias"),getCloudflareLatestDeployment=__name(async()=>{let{sha:commitHash}=useContext(),deployment=(await getCloudflareDeployments())?.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 ERROR_KEY="Status Of Deployment:",statusCloudflareDeployment=__name(async()=>{let deploymentStatus="unknown",deployment;do try{deployment=await getCloudflareLatestDeployment();let deployStage=deployment.stages.find(stage=>stage.name==="deploy");switch(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()=>{let{cloudflareAccountId,cloudflareProjectName,directory,cloudflareApiToken}=useInputs();process.env[CLOUDFLARE_API_TOKEN]=cloudflareApiToken,process.env[CLOUDFLARE_ACCOUNT_ID]=cloudflareAccountId;let{repo,branch,sha:commitHash}=useContext();if(branch===void 0)throw new Error(`${ERROR_KEY2} branch is undefined`);try{let WRANGLER_VERSION="3.28.1";strict(WRANGLER_VERSION,"wrangler version should exist");let{stdout}=await execAsync(`npx wrangler@${WRANGLER_VERSION} pages deploy ${directory} --project-name=${cloudflareProjectName} --branch=${branch} --commit-dirty=true --commit-hash=${commitHash}`,{env:process.env});info(stdout);let{deployment,status}=await statusCloudflareDeployment();setOutput("id",deployment.id),setOutput("url",deployment.url),setOutput("environment",deployment.environment);let alias=getCloudflareDeploymentAlias(deployment);return setOutput("alias",alias),await summary.addHeading("Cloudflare Pages Deployment").write(),await summary.addBreak().write(),await summary.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}`]]).write(),deployment}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 getCloudflareProject=__name(async()=>{let url=getCloudflareApiEndpoint();return await fetchResult(url)},"getCloudflareProject");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/dist/index.js.map b/dist/index.js.map
index 260158c1..94a8b9ec 100644
--- a/dist/index.js.map
+++ b/dist/index.js.map
@@ -1,7 +1,7 @@
{
"version": 3,
"sources": ["../node_modules/.pnpm/@unlike+github-actions-core@1.0.0/node_modules/@unlike/github-actions-core/src/variables.ts", "../node_modules/.pnpm/@unlike+github-actions-core@1.0.0/node_modules/@unlike/github-actions-core/src/lib/command.ts", "../node_modules/.pnpm/@unlike+github-actions-core@1.0.0/node_modules/@unlike/github-actions-core/src/lib/utils.ts", "../node_modules/.pnpm/@unlike+github-actions-core@1.0.0/node_modules/@unlike/github-actions-core/src/lib/file-command.ts", "../node_modules/.pnpm/@unlike+github-actions-core@1.0.0/node_modules/@unlike/github-actions-core/src/types.ts", "../node_modules/.pnpm/@unlike+github-actions-core@1.0.0/node_modules/@unlike/github-actions-core/src/errors.ts", "../node_modules/.pnpm/@unlike+github-actions-core@1.0.0/node_modules/@unlike/github-actions-core/src/logging.ts", "../node_modules/.pnpm/@unlike+github-actions-core@1.0.0/node_modules/@unlike/github-actions-core/src/lib/summary.ts", "../src/cloudflare/deployment/create.ts", "../src/utils.ts", "../src/github/workflow-event/workflow-event.ts", "../__generated__/types/github/workflow-events.ts", "../src/github/context.ts", "../input-keys.ts", "../src/inputs.ts", "../src/cloudflare/api/endpoints.ts", "../src/cloudflare/api/parse-error.ts", "../src/cloudflare/api/fetch-error.ts", "../src/cloudflare/api/fetch-result.ts", "../src/cloudflare/deployment/get.ts", "../src/cloudflare/deployment/status.ts", "../src/cloudflare/project/get.ts", "../__generated__/gql/graphql.ts", "../src/cloudflare/deployment/delete.ts", "../src/github/api/client.ts", "../__generated__/gql/gql.ts", "../src/github/deployment/delete.ts", "../node_modules/.pnpm/@octokit-next+endpoint@2.7.1/node_modules/@octokit-next/endpoint/lib/util/lowercase-keys.js", "../node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js", "../node_modules/.pnpm/@octokit-next+endpoint@2.7.1/node_modules/@octokit-next/endpoint/lib/util/merge-deep.js", "../node_modules/.pnpm/@octokit-next+endpoint@2.7.1/node_modules/@octokit-next/endpoint/lib/util/remove-undefined-properties.js", "../node_modules/.pnpm/@octokit-next+endpoint@2.7.1/node_modules/@octokit-next/endpoint/lib/merge.js", "../node_modules/.pnpm/@octokit-next+endpoint@2.7.1/node_modules/@octokit-next/endpoint/lib/util/add-query-parameters.js", "../node_modules/.pnpm/@octokit-next+endpoint@2.7.1/node_modules/@octokit-next/endpoint/lib/util/extract-url-variable-names.js", "../node_modules/.pnpm/@octokit-next+endpoint@2.7.1/node_modules/@octokit-next/endpoint/lib/util/omit.js", "../node_modules/.pnpm/@octokit-next+endpoint@2.7.1/node_modules/@octokit-next/endpoint/lib/util/url-template.js", "../node_modules/.pnpm/@octokit-next+endpoint@2.7.1/node_modules/@octokit-next/endpoint/lib/parse.js", "../node_modules/.pnpm/@octokit-next+endpoint@2.7.1/node_modules/@octokit-next/endpoint/lib/endpoint-with-defaults.js", "../node_modules/.pnpm/@octokit-next+endpoint@2.7.1/node_modules/@octokit-next/endpoint/lib/with-defaults.js", "../node_modules/.pnpm/universal-user-agent@7.0.2/node_modules/universal-user-agent/index.js", "../node_modules/.pnpm/@octokit-next+endpoint@2.7.1/node_modules/@octokit-next/endpoint/lib/version.js", "../node_modules/.pnpm/@octokit-next+endpoint@2.7.1/node_modules/@octokit-next/endpoint/lib/defaults.js", "../node_modules/.pnpm/@octokit-next+endpoint@2.7.1/node_modules/@octokit-next/endpoint/index.js", "../node_modules/.pnpm/@octokit-next+request@2.7.1/node_modules/@octokit-next/request/lib/version.js", "../node_modules/.pnpm/is-plain-object@5.0.0/node_modules/is-plain-object/dist/is-plain-object.mjs", "../node_modules/.pnpm/@octokit-next+request-error@2.7.1/node_modules/@octokit-next/request-error/index.js", "../node_modules/.pnpm/@octokit-next+request@2.7.1/node_modules/@octokit-next/request/lib/get-buffer-response.js", "../node_modules/.pnpm/@octokit-next+request@2.7.1/node_modules/@octokit-next/request/lib/fetch-wrapper.js", "../node_modules/.pnpm/@octokit-next+request@2.7.1/node_modules/@octokit-next/request/lib/with-defaults.js", "../node_modules/.pnpm/@octokit-next+request@2.7.1/node_modules/@octokit-next/request/index.js", "../node_modules/.pnpm/@octokit-next+auth-token@2.7.1/node_modules/@octokit-next/auth-token/lib/auth.js", "../node_modules/.pnpm/@octokit-next+auth-token@2.7.1/node_modules/@octokit-next/auth-token/lib/with-authorization-prefix.js", "../node_modules/.pnpm/@octokit-next+auth-token@2.7.1/node_modules/@octokit-next/auth-token/lib/hook.js", "../node_modules/.pnpm/@octokit-next+auth-token@2.7.1/node_modules/@octokit-next/auth-token/index.js", "../node_modules/.pnpm/@octokit-next+graphql@2.7.1/node_modules/@octokit-next/graphql/lib/version.js", "../node_modules/.pnpm/@octokit-next+graphql@2.7.1/node_modules/@octokit-next/graphql/lib/error.js", "../node_modules/.pnpm/@octokit-next+graphql@2.7.1/node_modules/@octokit-next/graphql/lib/graphql.js", "../node_modules/.pnpm/@octokit-next+graphql@2.7.1/node_modules/@octokit-next/graphql/lib/with-defaults.js", "../node_modules/.pnpm/@octokit-next+graphql@2.7.1/node_modules/@octokit-next/graphql/index.js", "../node_modules/.pnpm/before-after-hook@3.0.2/node_modules/before-after-hook/lib/register.js", "../node_modules/.pnpm/before-after-hook@3.0.2/node_modules/before-after-hook/lib/add.js", "../node_modules/.pnpm/before-after-hook@3.0.2/node_modules/before-after-hook/lib/remove.js", "../node_modules/.pnpm/before-after-hook@3.0.2/node_modules/before-after-hook/index.js", "../node_modules/.pnpm/@octokit-next+core@2.7.1/node_modules/@octokit-next/core/lib/version.js", "../node_modules/.pnpm/@octokit-next+core@2.7.1/node_modules/@octokit-next/core/index.js", "../node_modules/.pnpm/@octokit+plugin-paginate-rest@10.0.0_@octokit+core@6.0.1/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js", "../src/github/api/paginate.ts", "../src/github/deployment/get.ts", "../src/github/deployment/status.ts", "../src/delete.ts", "../src/github/comment.ts", "../src/github/environment.ts", "../src/github/deployment/create.ts", "../src/main.ts", "../src/index.ts"],
- "sourcesContent": ["import type {InputOptions} from './types.js'\n\nimport {EOL} from 'node:os'\nimport {delimiter} from 'node:path'\n\nimport {issue, issueCommand} from './lib/command.js'\nimport {issueFileCommand, prepareKeyValueMessage} from './lib/file-command.js'\nimport {toCommandValue} from './lib/utils.js'\n\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const exportVariable = (name: string, val: any): void => {\n const convertedVal = toCommandValue(val)\n process.env[name] = convertedVal\n\n const filePath = process.env['GITHUB_ENV'] || ''\n if (filePath) {\n return issueFileCommand('ENV', prepareKeyValueMessage(name, val))\n }\n\n issueCommand('set-env', {name}, convertedVal)\n}\n\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nexport const setSecret = (secret: string): void => {\n issueCommand('add-mask', {}, secret)\n}\n\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nexport const addPath = (inputPath: string): void => {\n const filePath = process.env['GITHUB_PATH'] || ''\n if (filePath) {\n issueFileCommand('PATH', inputPath)\n } else {\n issueCommand('add-path', {}, inputPath)\n }\n process.env['PATH'] = `${inputPath}${delimiter}${process.env['PATH']}`\n}\n\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nexport const getInput = (name: string, options?: InputOptions): string => {\n const val: string =\n process.env[`INPUT_${name.replaceAll(' ', '_').toUpperCase()}`] || ''\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`)\n }\n\n if (options && options.trimWhitespace === false) {\n return val\n }\n\n return val.trim()\n}\n\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nexport const getMultilineInput = (\n name: string,\n options?: InputOptions\n): string[] => {\n const inputs: string[] = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '')\n\n if (options && options.trimWhitespace === false) {\n return inputs\n }\n\n return inputs.map(input => input.trim())\n}\n\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nexport const getBooleanInput = (\n name: string,\n options?: InputOptions\n): boolean => {\n const trueValue = ['true', 'True', 'TRUE']\n const falseValue = ['false', 'False', 'FALSE']\n const val = getInput(name, options)\n if (trueValue.includes(val)) return true\n if (falseValue.includes(val)) return false\n throw new TypeError(\n `Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``\n )\n}\n\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const setOutput = (name: string, value: any): void => {\n const filePath = process.env['GITHUB_OUTPUT'] || ''\n if (filePath) {\n return issueFileCommand('OUTPUT', prepareKeyValueMessage(name, value))\n }\n\n process.stdout.write(EOL)\n issueCommand('set-output', {name}, toCommandValue(value))\n}\n\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nexport const setCommandEcho = (enabled: boolean): void => {\n issue('echo', enabled ? 'on' : 'off')\n}\n", "import type {CommandProperties} from '../types.js'\n\nimport {EOL} from 'node:os'\n\nimport {toCommandValue} from './utils.js'\n\n// For internal use, subject to change.\n\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nexport const issueCommand = (\n command: string,\n properties: CommandProperties,\n message: any\n): void => {\n const cmd = new Command(command, properties, message)\n process.stdout.write(cmd.toString() + EOL)\n}\n\nexport const issue = (name: string, message = ''): void => {\n issueCommand(name, {}, message)\n}\n\nconst CMD_STRING = '::'\n\nclass Command {\n readonly #command: string\n readonly #message: string\n readonly #properties: CommandProperties\n\n constructor(command: string, properties: CommandProperties, message: string) {\n if (!command) {\n command = 'missing.command'\n }\n\n this.#command = command\n this.#properties = properties\n this.#message = message\n }\n\n toString(): string {\n let cmdStr = CMD_STRING + this.#command\n\n if (this.#properties && Object.keys(this.#properties).length > 0) {\n cmdStr += ' '\n let first = true\n for (const key in this.#properties) {\n if (this.#properties.hasOwnProperty(key)) {\n const val = this.#properties[key]\n if (val) {\n if (first) {\n first = false\n } else {\n cmdStr += ','\n }\n\n cmdStr += `${key}=${escapeProperty(val)}`\n }\n }\n }\n }\n\n cmdStr += `${CMD_STRING}${escapeData(this.#message)}`\n return cmdStr\n }\n}\n\nfunction escapeData(s: any): string {\n return toCommandValue(s)\n .replaceAll('%', '%25')\n .replaceAll('\\r', '%0D')\n .replaceAll('\\n', '%0A')\n}\n\nfunction escapeProperty(s: any): string {\n return toCommandValue(s)\n .replaceAll('%', '%25')\n .replaceAll('\\r', '%0D')\n .replaceAll('\\n', '%0A')\n .replaceAll(':', '%3A')\n .replaceAll(',', '%2C')\n}\n", "// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type {AnnotationProperties, CommandProperties} from '../types.js'\n\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nexport const toCommandValue = (input: any): string => {\n if (input === null || input === undefined) {\n return ''\n } else if (typeof input === 'string' || input instanceof String) {\n return input as string\n }\n return JSON.stringify(input)\n}\n\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nexport const toCommandProperties = (\n annotationProperties: AnnotationProperties\n): CommandProperties => {\n if (!annotationProperties || Object.keys(annotationProperties).length === 0) {\n return {}\n }\n\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n }\n}\n", "// For internal use, subject to change.\n\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport {randomUUID as uuidv4} from 'node:crypto'\nimport {appendFileSync, existsSync} from 'node:fs'\nimport {EOL} from 'node:os'\n\nimport {toCommandValue} from './utils.js'\n\nexport const issueFileCommand = (command: string, message: any): void => {\n const filePath = process.env[`GITHUB_${command}`]\n if (!filePath) {\n throw new Error(\n `Unable to find environment variable for file command ${command}`\n )\n }\n if (!existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`)\n }\n\n appendFileSync(filePath, `${toCommandValue(message)}${EOL}`, {\n encoding: 'utf8'\n })\n}\n\nexport const prepareKeyValueMessage = (key: string, value: any): string => {\n const delimiter = `ghadelimiter_${uuidv4()}`\n const convertedValue = toCommandValue(value)\n\n // These should realistically never happen, but just in case someone finds a\n // way to exploit uuid generation let's not allow keys or values that contain\n // the delimiter.\n if (key.includes(delimiter)) {\n throw new Error(\n `Unexpected input: name should not contain the delimiter \"${delimiter}\"`\n )\n }\n\n if (convertedValue.includes(delimiter)) {\n throw new Error(\n `Unexpected input: value should not contain the delimiter \"${delimiter}\"`\n )\n }\n\n return `${key}<<${delimiter}${EOL}${convertedValue}${EOL}${delimiter}`\n}\n", "/**\n * Interface for getInput options\n */\nexport interface InputOptions {\n /** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */\n required?: boolean\n\n /** Optional. Whether leading/trailing whitespace will be trimmed for the input. Defaults to true */\n trimWhitespace?: boolean\n}\n\n/**\n * The code to exit an action\n */\nexport enum ExitCode {\n /**\n * A code indicating that the action was successful\n */\n Success = 0,\n\n /**\n * A code indicating that the action was a failure\n */\n Failure = 1\n}\n\n/**\n * Optional properties that can be sent with annotation commands (notice, error, and warning)\n * See: https://docs.github.com/en/rest/reference/checks#create-a-check-run for more information about annotations.\n */\nexport interface AnnotationProperties {\n /**\n * A title for the annotation.\n */\n title?: string\n\n /**\n * The path of the file for which the annotation should be created.\n */\n file?: string\n\n /**\n * The start line for the annotation.\n */\n startLine?: number\n\n /**\n * The end line for the annotation. Defaults to `startLine` when `startLine` is provided.\n */\n endLine?: number\n\n /**\n * The start column for the annotation. Cannot be sent when `startLine` and `endLine` are different values.\n */\n startColumn?: number\n\n /**\n * The end column for the annotation. Cannot be sent when `startLine` and `endLine` are different values.\n * Defaults to `startColumn` when `startColumn` is provided.\n */\n endColumn?: number\n}\n\nexport interface CommandProperties {\n [key: string]: unknown\n}\n", "import type {AnnotationProperties} from './types.js'\n\nimport {issueCommand} from './lib/command.js'\nimport {toCommandProperties} from './lib/utils.js'\nimport {ExitCode} from './types.js'\n\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport const error = (\n message: string | Error,\n properties: AnnotationProperties = {}\n): void => {\n issueCommand(\n 'error',\n toCommandProperties(properties),\n message instanceof Error ? message.toString() : message\n )\n}\n\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nexport const setFailed = (message: string | Error): void => {\n process.exitCode = ExitCode.Failure\n\n error(message)\n}\n", "import {EOL} from 'node:os'\n\nimport {issue, issueCommand} from './lib/command.js'\nimport {toCommandProperties} from './lib/utils.js'\nimport {type AnnotationProperties} from './types.js'\n\n/**\n * Gets whether Actions Step Debug is on or not\n */\nexport const isDebug = (): boolean => {\n return process.env['RUNNER_DEBUG'] === '1'\n}\n\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nexport const debug = (message: string): void => {\n issueCommand('debug', {}, message)\n}\n\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport const warning = (\n message: string | Error,\n properties: AnnotationProperties = {}\n): void => {\n issueCommand(\n 'warning',\n toCommandProperties(properties),\n message instanceof Error ? message.toString() : message\n )\n}\n\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport const notice = (\n message: string | Error,\n properties: AnnotationProperties = {}\n): void => {\n issueCommand(\n 'notice',\n toCommandProperties(properties),\n message instanceof Error ? message.toString() : message\n )\n}\n\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nexport const info = (message: string): void => {\n process.stdout.write(message + EOL)\n}\n\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nexport const startGroup = (name: string): void => {\n issue('group', name)\n}\n\n/**\n * End an output group.\n */\nexport const endGroup = (): void => {\n issue('endgroup')\n}\n\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nexport const group = async (\n name: string,\n fn: () => Promise\n): Promise => {\n startGroup(name)\n\n let result: T\n\n try {\n result = await fn()\n } finally {\n endGroup()\n }\n\n return result\n}\n", "/* eslint-disable unicorn/no-null */\n\nimport {constants, promises} from 'node:fs'\nimport {EOL} from 'node:os'\n\nconst {access, appendFile, writeFile} = promises\n\nexport const SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'\nexport const SUMMARY_DOCS_URL =\n 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'\n\nexport type SummaryTableRow = (SummaryTableCell | string)[]\n\nexport interface SummaryTableCell {\n /**\n * Cell content\n */\n data: string\n /**\n * Render cell as header\n * (optional) default: false\n */\n header?: boolean\n /**\n * Number of columns the cell extends\n * (optional) default: '1'\n */\n colspan?: string\n /**\n * Number of rows the cell extends\n * (optional) default: '1'\n */\n rowspan?: string\n}\n\nexport interface SummaryImageOptions {\n /**\n * The width of the image in pixels. Must be an integer without a unit.\n * (optional)\n */\n width?: string\n /**\n * The height of the image in pixels. Must be an integer without a unit.\n * (optional)\n */\n height?: string\n}\n\nexport interface SummaryWriteOptions {\n /**\n * Replace all existing content in summary file with buffer contents\n * (optional) default: false\n */\n overwrite?: boolean\n}\n\nclass Summary {\n #buffer: string\n #filePath?: string\n\n constructor() {\n this.#buffer = ''\n }\n\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n async #fileSummaryPath(): Promise {\n if (this.#filePath) {\n return this.#filePath\n }\n\n const pathFromEnv = process.env[SUMMARY_ENV_VAR]\n if (!pathFromEnv) {\n throw new Error(\n `Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`\n )\n }\n\n try {\n await access(pathFromEnv, constants.R_OK | constants.W_OK)\n } catch {\n throw new Error(\n `Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`\n )\n }\n\n this.#filePath = pathFromEnv\n return this.#filePath\n }\n\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n #wrap(\n tag: string,\n content: string | null,\n attrs: {[attribute: string]: string} = {}\n ): string {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('')\n\n if (!content) {\n return `<${tag}${htmlAttrs}>`\n }\n\n return `<${tag}${htmlAttrs}>${content}${tag}>`\n }\n\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n async write(options?: SummaryWriteOptions): Promise {\n const overwrite = !!options?.overwrite\n const filePath = await this.#fileSummaryPath()\n const writeFunc = overwrite ? writeFile : appendFile\n await writeFunc(filePath, this.#buffer, {encoding: 'utf8'})\n return this.emptyBuffer()\n }\n\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n async clear(): Promise {\n return this.emptyBuffer().write({overwrite: true})\n }\n\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify(): string {\n return this.#buffer\n }\n\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer(): boolean {\n return this.#buffer.length === 0\n }\n\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer(): Summary {\n this.#buffer = ''\n return this\n }\n\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text: string, addEOL = false): Summary {\n this.#buffer += text\n return addEOL ? this.addEOL() : this\n }\n\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL(): Summary {\n return this.addRaw(EOL)\n }\n\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code: string, lang?: string): Summary {\n const attrs = {\n ...(lang && {lang})\n }\n const element = this.#wrap('pre', this.#wrap('code', code), attrs)\n return this.addRaw(element).addEOL()\n }\n\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items: string[], ordered = false): Summary {\n const tag = ordered ? 'ol' : 'ul'\n const listItems = items.map(item => this.#wrap('li', item)).join('')\n const element = this.#wrap(tag, listItems)\n return this.addRaw(element).addEOL()\n }\n\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows: SummaryTableRow[]): Summary {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.#wrap('td', cell)\n }\n\n const {header, data, colspan, rowspan} = cell\n const tag = header ? 'th' : 'td'\n const attrs = {\n ...(colspan && {colspan}),\n ...(rowspan && {rowspan})\n }\n\n return this.#wrap(tag, data, attrs)\n })\n .join('')\n\n return this.#wrap('tr', cells)\n })\n .join('')\n\n const element = this.#wrap('table', tableBody)\n return this.addRaw(element).addEOL()\n }\n\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label: string, content: string): Summary {\n const element = this.#wrap(\n 'details',\n this.#wrap('summary', label) + content\n )\n return this.addRaw(element).addEOL()\n }\n\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src: string, alt: string, options?: SummaryImageOptions): Summary {\n const {width, height} = options || {}\n const attrs = {\n ...(width && {width}),\n ...(height && {height})\n }\n\n const element = this.#wrap('img', null, {src, alt, ...attrs})\n return this.addRaw(element).addEOL()\n }\n\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text: string, level?: number | string): Summary {\n const tag = `h${level}`\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1'\n const element = this.#wrap(allowedTag, text)\n return this.addRaw(element).addEOL()\n }\n\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator(): Summary {\n const element = this.#wrap('hr', null)\n return this.addRaw(element).addEOL()\n }\n\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak(): Summary {\n const element = this.#wrap('br', null)\n return this.addRaw(element).addEOL()\n }\n\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text: string, cite?: string): Summary {\n const attrs = {\n ...(cite && {cite})\n }\n const element = this.#wrap('blockquote', text, attrs)\n return this.addRaw(element).addEOL()\n }\n\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text: string, href: string): Summary {\n const element = this.#wrap('a', text, {href})\n return this.addRaw(element).addEOL()\n }\n}\n\nconst _summary = new Summary()\n\nexport const summary = _summary\n", "import {strict} from 'node:assert'\n\nimport {setOutput, summary} from '@unlike/github-actions-core'\n\nimport {useContext} from '../../github/context.js'\nimport {useInputs} from '../../inputs.js'\nimport {execAsync} from '../../utils.js'\nimport {getCloudflareDeploymentAlias} from './get.js'\nimport {statusCloudflareDeployment} from './status.js'\n\nexport const CLOUDFLARE_API_TOKEN = 'CLOUDFLARE_API_TOKEN'\nexport const CLOUDFLARE_ACCOUNT_ID = 'CLOUDFLARE_ACCOUNT_ID'\nconst ERROR_KEY = `Create Deployment:`\n\nexport const createCloudflareDeployment = async () => {\n const {\n cloudflareAccountId,\n cloudflareProjectName,\n directory,\n cloudflareApiToken\n } = useInputs()\n\n process.env[CLOUDFLARE_API_TOKEN] = cloudflareApiToken\n process.env[CLOUDFLARE_ACCOUNT_ID] = cloudflareAccountId\n\n const {repo, branch, sha: commitHash} = useContext()\n\n if (branch === undefined) {\n throw new Error(`${ERROR_KEY} branch is undefined`)\n }\n\n try {\n /**\n * At build process.env.npm_package_dependencies_wrangler is replaced by esbuild define.\n * @see {@link ../../esbuild.config.js}\n * @see {@link https://esbuild.github.io/api/#define | esbuild define}\n * @see {@link https://docs.npmjs.com/cli/v9/using-npm/scripts#packagejson-vars | package.json vars}\n */\n const WRANGLER_VERSION = process.env.npm_package_dependencies_wrangler\n strict(WRANGLER_VERSION, 'wrangler version should exist')\n /**\n * Tried to use wrangler.unstable_pages.deploy. But wrangler is 8mb+ and the bundler is unable to tree shake it.\n */\n await execAsync(\n `npx wrangler@${WRANGLER_VERSION} pages deploy ${directory} --project-name=${cloudflareProjectName} --branch=${branch} --commit-dirty=true --commit-hash=${commitHash}`,\n {\n env: process.env\n }\n )\n /**\n * Get the latest deployment by commitHash and poll until required status.\n */\n const {deployment, status} = await statusCloudflareDeployment()\n\n setOutput('id', deployment.id)\n setOutput('url', deployment.url)\n setOutput('environment', deployment.environment)\n\n const alias: string = getCloudflareDeploymentAlias(deployment)\n setOutput('alias', alias)\n\n await summary.addHeading('Cloudflare Pages Deployment').write()\n await summary.addBreak().write()\n await summary\n .addTable([\n [\n {\n data: 'Name',\n header: true\n },\n {\n data: 'Result',\n header: true\n }\n ],\n ['Environment:', deployment.environment],\n [\n 'Branch:',\n `${deployment.deployment_trigger.metadata.branch}
`\n ],\n [\n 'Commit Hash:',\n `${deployment.deployment_trigger.metadata.commit_hash}
`\n ],\n [\n 'Commit Message:',\n deployment.deployment_trigger.metadata.commit_message\n ],\n ['Status:', `${status.toUpperCase() || `UNKNOWN`}`],\n ['Preview URL:', `${deployment.url}`],\n ['Branch Preview URL:', `${alias}`]\n ])\n .write()\n\n return deployment\n } catch (error) {\n if (error instanceof Error) {\n throw error\n }\n if (\n error &&\n typeof error === 'object' &&\n 'stderr' in error &&\n typeof error.stderr === 'string'\n ) {\n throw new Error(error.stderr)\n }\n throw new Error(`${ERROR_KEY} unknown error`)\n }\n}\n", "import {exec} from 'node:child_process'\nimport {promisify} from 'node:util'\n\nimport {setFailed} from '@unlike/github-actions-core'\n\nexport const raise = (message: string): never => {\n throw new Error(message)\n}\n\nexport const raiseFail = (message: string): never => {\n setFailed(message)\n throw new Error(message)\n}\n\nexport const execAsync = promisify(exec)\n", "import {strict as assert} from 'node:assert'\nimport {existsSync, readFileSync} from 'node:fs'\nimport {EOL} from 'node:os'\n\nimport {debug, isDebug} from '@unlike/github-actions-core'\n\nimport type {EventName} from '@/types/github/workflow-events.js'\n\nimport {EVENT_NAMES} from '@/types/github/workflow-events.js'\n\nimport type {WorkflowEventExtract, WorkflowEventPayload} from './types.js'\n\n/**\n * Loads the file from the runner that contains the full event webhook payload.\n */\nconst getPayload = (): unknown => {\n if (process.env.GITHUB_EVENT_PATH) {\n if (existsSync(process.env.GITHUB_EVENT_PATH)) {\n return JSON.parse(\n readFileSync(process.env.GITHUB_EVENT_PATH, {encoding: 'utf8'})\n )\n } else {\n const path = process.env.GITHUB_EVENT_PATH\n process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${EOL}`)\n }\n }\n}\n\nexport const getWorkflowEvent = () => {\n const eventName = process.env.GITHUB_EVENT_NAME as EventName\n\n assert(\n EVENT_NAMES.includes(eventName),\n `eventName ${eventName} is not supported`\n )\n /** Assume that the payload matches the eventName */\n const payload = getPayload() as WorkflowEventPayload\n\n if (isDebug()) {\n debug(`eventName: ${eventName}`)\n debug(`payload: ${JSON.stringify(payload)}`)\n }\n\n return {\n eventName,\n payload\n } as Readonly>\n}\n", "import type {\n BranchProtectionRuleEvent,\n CheckRunEvent,\n CheckSuiteEvent,\n CodeScanningAlertEvent,\n CommitCommentEvent,\n CreateEvent,\n DeleteEvent,\n DependabotAlertEvent,\n DeployKeyEvent,\n DeploymentEvent,\n DeploymentProtectionRuleEvent,\n DeploymentReviewEvent,\n DeploymentStatusEvent,\n DiscussionCommentEvent,\n DiscussionEvent,\n ForkEvent,\n GithubAppAuthorizationEvent,\n GollumEvent,\n InstallationEvent,\n InstallationRepositoriesEvent,\n InstallationTargetEvent,\n IssueCommentEvent,\n IssuesEvent,\n LabelEvent,\n MarketplacePurchaseEvent,\n MemberEvent,\n MembershipEvent,\n MergeGroupEvent,\n MetaEvent,\n MilestoneEvent,\n OrganizationEvent,\n OrgBlockEvent,\n PackageEvent,\n PageBuildEvent,\n PingEvent,\n ProjectCardEvent,\n ProjectColumnEvent,\n ProjectEvent,\n ProjectsV2ItemEvent,\n PublicEvent,\n PullRequestEvent,\n PullRequestReviewCommentEvent,\n PullRequestReviewEvent,\n PullRequestReviewThreadEvent,\n PushEvent,\n RegistryPackageEvent,\n ReleaseEvent,\n RepositoryDispatchEvent,\n RepositoryEvent,\n RepositoryImportEvent,\n RepositoryVulnerabilityAlertEvent,\n Schema,\n SecretScanningAlertEvent,\n SecretScanningAlertLocationEvent,\n SecurityAdvisoryEvent,\n SponsorshipEvent,\n StarEvent,\n StatusEvent,\n TeamAddEvent,\n TeamEvent,\n WatchEvent,\n WebhookEventName,\n WorkflowDispatchEvent,\n WorkflowJobEvent,\n WorkflowRunEvent\n} from '@octokit/webhooks-types'\n\nexport const EVENT_NAMES = [\n 'branch_protection_rule',\n 'check_run',\n 'check_suite',\n 'code_scanning_alert',\n 'commit_comment',\n 'create',\n 'delete',\n 'dependabot_alert',\n 'deploy_key',\n 'deployment',\n 'deployment_protection_rule',\n 'deployment_review',\n 'deployment_status',\n 'discussion',\n 'discussion_comment',\n 'fork',\n 'github_app_authorization',\n 'gollum',\n 'installation',\n 'installation_repositories',\n 'installation_target',\n 'issue_comment',\n 'issues',\n 'label',\n 'marketplace_purchase',\n 'member',\n 'membership',\n 'merge_group',\n 'meta',\n 'milestone',\n 'org_block',\n 'organization',\n 'package',\n 'page_build',\n 'ping',\n 'project',\n 'project_card',\n 'project_column',\n 'projects_v2_item',\n 'public',\n 'pull_request',\n 'pull_request_review',\n 'pull_request_review_comment',\n 'pull_request_review_thread',\n 'push',\n 'registry_package',\n 'release',\n 'repository',\n 'repository_dispatch',\n 'repository_import',\n 'repository_vulnerability_alert',\n 'secret_scanning_alert',\n 'secret_scanning_alert_location',\n 'security_advisory',\n 'sponsorship',\n 'star',\n 'status',\n 'team',\n 'team_add',\n 'watch',\n 'workflow_dispatch',\n 'workflow_job',\n 'workflow_run'\n] satisfies Array\nexport type EventName = (typeof EVENT_NAMES)[number]\nexport interface WorkflowEventBase {\n eventName: WebhookEventName\n payload: Schema\n}\nexport type WorkflowEvent =\n | {\n eventName: 'branch_protection_rule'\n payload: BranchProtectionRuleEvent\n }\n | {\n eventName: 'check_run'\n payload: CheckRunEvent\n }\n | {\n eventName: 'check_suite'\n payload: CheckSuiteEvent\n }\n | {\n eventName: 'code_scanning_alert'\n payload: CodeScanningAlertEvent\n }\n | {\n eventName: 'commit_comment'\n payload: CommitCommentEvent\n }\n | {\n eventName: 'create'\n payload: CreateEvent\n }\n | {\n eventName: 'delete'\n payload: DeleteEvent\n }\n | {\n eventName: 'dependabot_alert'\n payload: DependabotAlertEvent\n }\n | {\n eventName: 'deploy_key'\n payload: DeployKeyEvent\n }\n | {\n eventName: 'deployment'\n payload: DeploymentEvent\n }\n | {\n eventName: 'deployment_protection_rule'\n payload: DeploymentProtectionRuleEvent\n }\n | {\n eventName: 'deployment_review'\n payload: DeploymentReviewEvent\n }\n | {\n eventName: 'deployment_status'\n payload: DeploymentStatusEvent\n }\n | {\n eventName: 'discussion'\n payload: DiscussionEvent\n }\n | {\n eventName: 'discussion_comment'\n payload: DiscussionCommentEvent\n }\n | {\n eventName: 'fork'\n payload: ForkEvent\n }\n | {\n eventName: 'github_app_authorization'\n payload: GithubAppAuthorizationEvent\n }\n | {\n eventName: 'gollum'\n payload: GollumEvent\n }\n | {\n eventName: 'installation'\n payload: InstallationEvent\n }\n | {\n eventName: 'installation_repositories'\n payload: InstallationRepositoriesEvent\n }\n | {\n eventName: 'installation_target'\n payload: InstallationTargetEvent\n }\n | {\n eventName: 'issue_comment'\n payload: IssueCommentEvent\n }\n | {\n eventName: 'issues'\n payload: IssuesEvent\n }\n | {\n eventName: 'label'\n payload: LabelEvent\n }\n | {\n eventName: 'marketplace_purchase'\n payload: MarketplacePurchaseEvent\n }\n | {\n eventName: 'member'\n payload: MemberEvent\n }\n | {\n eventName: 'membership'\n payload: MembershipEvent\n }\n | {\n eventName: 'merge_group'\n payload: MergeGroupEvent\n }\n | {\n eventName: 'meta'\n payload: MetaEvent\n }\n | {\n eventName: 'milestone'\n payload: MilestoneEvent\n }\n | {\n eventName: 'org_block'\n payload: OrgBlockEvent\n }\n | {\n eventName: 'organization'\n payload: OrganizationEvent\n }\n | {\n eventName: 'package'\n payload: PackageEvent\n }\n | {\n eventName: 'page_build'\n payload: PageBuildEvent\n }\n | {\n eventName: 'ping'\n payload: PingEvent\n }\n | {\n eventName: 'project'\n payload: ProjectEvent\n }\n | {\n eventName: 'project_card'\n payload: ProjectCardEvent\n }\n | {\n eventName: 'project_column'\n payload: ProjectColumnEvent\n }\n | {\n eventName: 'projects_v2_item'\n payload: ProjectsV2ItemEvent\n }\n | {\n eventName: 'public'\n payload: PublicEvent\n }\n | {\n eventName: 'pull_request'\n payload: PullRequestEvent\n }\n | {\n eventName: 'pull_request_review'\n payload: PullRequestReviewEvent\n }\n | {\n eventName: 'pull_request_review_comment'\n payload: PullRequestReviewCommentEvent\n }\n | {\n eventName: 'pull_request_review_thread'\n payload: PullRequestReviewThreadEvent\n }\n | {\n eventName: 'push'\n payload: PushEvent\n }\n | {\n eventName: 'registry_package'\n payload: RegistryPackageEvent\n }\n | {\n eventName: 'release'\n payload: ReleaseEvent\n }\n | {\n eventName: 'repository'\n payload: RepositoryEvent\n }\n | {\n eventName: 'repository_dispatch'\n payload: RepositoryDispatchEvent\n }\n | {\n eventName: 'repository_import'\n payload: RepositoryImportEvent\n }\n | {\n eventName: 'repository_vulnerability_alert'\n payload: RepositoryVulnerabilityAlertEvent\n }\n | {\n eventName: 'secret_scanning_alert'\n payload: SecretScanningAlertEvent\n }\n | {\n eventName: 'secret_scanning_alert_location'\n payload: SecretScanningAlertLocationEvent\n }\n | {\n eventName: 'security_advisory'\n payload: SecurityAdvisoryEvent\n }\n | {\n eventName: 'sponsorship'\n payload: SponsorshipEvent\n }\n | {\n eventName: 'star'\n payload: StarEvent\n }\n | {\n eventName: 'status'\n payload: StatusEvent\n }\n | {\n eventName: 'team'\n payload: TeamEvent\n }\n | {\n eventName: 'team_add'\n payload: TeamAddEvent\n }\n | {\n eventName: 'watch'\n payload: WatchEvent\n }\n | {\n eventName: 'workflow_dispatch'\n payload: WorkflowDispatchEvent\n }\n | {\n eventName: 'workflow_job'\n payload: WorkflowJobEvent\n }\n | {\n eventName: 'workflow_run'\n payload: WorkflowRunEvent\n }\n", "/* eslint-disable no-console */\n\nimport {debug, isDebug} from '@unlike/github-actions-core'\n\nimport {raise} from '../utils.js'\nimport {getWorkflowEvent} from './workflow-event/workflow-event.js'\n\ninterface Repo {\n owner: string\n repo: string\n /**\n * The GraphQL identifier of the repository.\n */\n node_id: string\n}\n\ninterface Context {\n /**\n * The event that triggered the workflow run.\n */\n event: ReturnType\n repo: Repo\n /**\n * The branch or tag ref that triggered the workflow run.\n */\n branch?: string\n /**\n * The commit SHA that triggered the workflow. The value of this commit SHA\n * depends on the event that triggered the workflow.\n * For more information, see \"Events that trigger workflows.\"\n *\n * Example: `ffac537e6cbbf934b08745a378932722df287a53`.\n */\n sha: string\n /**\n * Returns the GraphQL API URL. For example: https://api.github.com/graphql.\n */\n graphqlEndpoint: string\n\n /**\n * refs/heads/feature-branch-1.\n */\n ref: string\n}\n\nconst getGitHubContext = (): Context => {\n const event = getWorkflowEvent()\n\n const repo = ((): Repo => {\n const [owner, repo] = process.env.GITHUB_REPOSITORY\n ? process.env.GITHUB_REPOSITORY.split('/')\n : raise(\n \"context.repo: requires a GITHUB_REPOSITORY environment variable like 'owner/repo'\"\n )\n\n const node_id =\n 'repository' in event.payload\n ? event.payload.repository?.node_id ||\n raise('context.repo: no repo node_id in payload')\n : raise('context.repo: no repo node_id in payload')\n\n return {owner, repo, node_id}\n })()\n\n /**\n * Depending on what event triggers the action.\n * The GITHUB_HEAD_REF may be undefined so we fallback to GITHUB_REF_NAME.\n */\n const branch = process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME\n\n const sha = process.env.GITHUB_SHA\n\n const graphqlEndpoint = process.env.GITHUB_GRAPHQL_URL\n\n const ref = ((): Context['ref'] => {\n let ref = process.env.GITHUB_HEAD_REF\n if (!ref) {\n if ('ref' in event.payload) {\n ref = event.payload.ref // refs/heads/feature-branch-1\n } else if (event.eventName === 'pull_request') {\n ref = event.payload.pull_request.head.ref // andykenward/issue18\n }\n if (!ref) return raise('context: no ref')\n }\n return ref\n })()\n\n const context = {\n event,\n repo,\n branch,\n sha,\n graphqlEndpoint,\n ref\n }\n\n if (isDebug()) {\n const debugContext = {\n ...context,\n event: 'will debug itself as output is large'\n }\n\n debug(`context: ${JSON.stringify(debugContext)}`)\n }\n\n return context\n}\n\ntype UseContext = ReturnType\n\nlet _context: UseContext\nexport const useContext = (): UseContext => {\n return process.env.NODE_ENV === 'test'\n ? getGitHubContext()\n : _context ?? (_context = getGitHubContext())\n}\n\nexport const useContextEvent = (): UseContext['event'] => useContext().event\n", "export const INPUT_KEY_CLOUDFLARE_ACCOUNT_ID = 'cloudflare-account-id' as const\nexport const INPUT_KEY_CLOUDFLARE_API_TOKEN = 'cloudflare-api-token' as const\nexport const INPUT_KEY_CLOUDFLARE_PROJECT_NAME =\n 'cloudflare-project-name' as const\nexport const INPUT_KEY_DIRECTORY = 'directory' as const\nexport const INPUT_KEY_GITHUB_ENVIRONMENT = 'github-environment' as const\nexport const INPUT_KEY_GITHUB_TOKEN = 'github-token' as const\n\nexport const INPUT_KEYS_REQUIRED = [\n INPUT_KEY_CLOUDFLARE_ACCOUNT_ID,\n INPUT_KEY_CLOUDFLARE_API_TOKEN,\n INPUT_KEY_CLOUDFLARE_PROJECT_NAME,\n INPUT_KEY_DIRECTORY,\n INPUT_KEY_GITHUB_ENVIRONMENT,\n INPUT_KEY_GITHUB_TOKEN\n] as const\n", "import type {InputOptions} from '@unlike/github-actions-core'\n\nimport {getInput} from '@unlike/github-actions-core'\n\nimport {\n INPUT_KEY_CLOUDFLARE_ACCOUNT_ID,\n INPUT_KEY_CLOUDFLARE_API_TOKEN,\n INPUT_KEY_CLOUDFLARE_PROJECT_NAME,\n INPUT_KEY_DIRECTORY,\n INPUT_KEY_GITHUB_ENVIRONMENT,\n INPUT_KEY_GITHUB_TOKEN\n} from '../input-keys.js'\n\nconst OPTIONS: InputOptions = {\n required: true\n}\n\ninterface Inputs {\n /** Cloudflare Account Id */\n cloudflareAccountId: string\n /** Cloudflare API token */\n cloudflareApiToken: string\n /** Cloudflare Pages Project Name */\n cloudflareProjectName: string\n /** Directory of static files to upload */\n directory: string\n /** GitHub API Token */\n gitHubApiToken: string\n /** GitHub Environment to use for deployment */\n gitHubEnvironment: string\n}\n\nconst getInputs = (): Inputs => {\n return {\n cloudflareAccountId: getInput(INPUT_KEY_CLOUDFLARE_ACCOUNT_ID, OPTIONS),\n cloudflareApiToken: getInput(INPUT_KEY_CLOUDFLARE_API_TOKEN, OPTIONS),\n cloudflareProjectName: getInput(INPUT_KEY_CLOUDFLARE_PROJECT_NAME, OPTIONS),\n directory: getInput(INPUT_KEY_DIRECTORY, OPTIONS),\n gitHubApiToken: getInput(INPUT_KEY_GITHUB_TOKEN, OPTIONS),\n gitHubEnvironment: getInput(INPUT_KEY_GITHUB_ENVIRONMENT, OPTIONS)\n }\n}\n\ntype UseInputs = ReturnType\n\nlet _inputs: UseInputs\n\nexport const useInputs = (): UseInputs => {\n return _inputs ?? (_inputs = getInputs())\n}\n", "import {useInputs} from '../../inputs.js'\n\nconst API_ENDPOINT = `https://api.cloudflare.com`\n\nexport const getCloudflareApiEndpoint = (path?: string): string => {\n const {cloudflareAccountId, cloudflareProjectName} = useInputs()\n\n const input: string = [\n `/client/v4/accounts/${cloudflareAccountId}/pages/projects/${cloudflareProjectName}`,\n path\n ]\n .filter(Boolean)\n .join('/')\n\n return new URL(input, API_ENDPOINT).toString()\n}\n\nexport const getCloudflareLogEndpoint = (id: string): string => {\n const {cloudflareAccountId, cloudflareProjectName} = useInputs()\n\n return new URL(\n `${cloudflareAccountId}/pages/view/${cloudflareProjectName}/${id}`,\n `https://dash.cloudflare.com`\n ).toString()\n}\n", "/**\n * Fork of\n * https://github.com/cloudflare/workers-sdk/blob/55703e52da35b15f5c11f9e3936cc5b1ad5836dc/packages/wrangler/src/parse.ts\n */\n\nexport type Message = {\n text: string\n location?: Location\n notes?: Message[]\n kind?: 'warning' | 'error'\n}\n\nexport type Location = File & {\n line: number\n column: number\n length?: number\n lineText?: string\n suggestion?: string\n}\n\nexport type File = {\n file?: string\n fileText?: string\n}\n\n/**\n * An error that's thrown when something fails to parse.\n */\nexport class ParseError extends Error implements Message {\n readonly text: string\n readonly notes: Message[]\n readonly location?: Location\n readonly kind: 'warning' | 'error'\n code: number | undefined\n\n constructor({text, notes, location, kind}: Message) {\n super(text)\n // eslint-disable-next-line unicorn/custom-error-definition\n this.name = this.constructor.name\n this.text = text\n this.notes = notes ?? []\n this.location = location\n this.kind = kind ?? 'error'\n }\n}\n", "import {error as coreError} from '@unlike/github-actions-core'\n\nimport type {FetchError, FetchResult} from '../types.js'\n\nimport {ParseError} from './parse-error.js'\n\n/**\n * Source: https://github.com/cloudflare/workers-sdk/blob/55703e52da35b15f5c11f9e3936cc5b1ad5836dc/packages/wrangler/src/cfetch/index.ts#L83-L101\n */\nexport const throwFetchError = (\n resource: string,\n response: FetchResult\n): never => {\n const error = new ParseError({\n text: `A request to the Cloudflare API (${resource}) failed.`,\n notes: response.errors.map(err => ({\n text: renderError(err)\n }))\n })\n const code = response.errors[0]?.code\n if (code) {\n error.code = code\n }\n if (error.notes?.length > 0) {\n error.notes.map(note => {\n // GitHub Action annotation\n coreError(`Cloudflare API: ${note.text}`)\n })\n }\n throw error\n}\n\n/**\n * Source: https://github.com/cloudflare/workers-sdk/blob/55703e52da35b15f5c11f9e3936cc5b1ad5836dc/packages/wrangler/src/cfetch/index.ts#L108-L120\n */\nconst renderError = (err: FetchError, level = 0): string => {\n const chainedMessages =\n err.error_chain\n ?.map(\n chainedError =>\n `\\n${' '.repeat(level)}- ${renderError(chainedError, level + 1)}`\n )\n .join('\\n') ?? ''\n return (\n (err.code ? `${err.message} [code: ${err.code}]` : err.message) +\n chainedMessages\n )\n}\n", "import type {FetchResult} from '../types.js'\n\nimport {useInputs} from '../../inputs.js'\nimport {throwFetchError} from './fetch-error.js'\n\nexport const fetchResult = async (\n resource: string,\n init: RequestInit = {},\n queryParams?: URLSearchParams,\n abortSignal?: AbortSignal\n): Promise => {\n const method = init.method ?? 'GET'\n const {cloudflareApiToken} = useInputs()\n\n const initFetch = {\n headers: {\n 'Content-Type': 'application/json;charset=UTF-8',\n Authorization: `Bearer ${cloudflareApiToken}`\n }\n }\n\n const response = (await fetch(resource, {\n method,\n ...initFetch,\n signal: abortSignal\n }).then(response => response.json())) as FetchResult\n\n if (response.success) {\n if (response.result === null || response.result === undefined) {\n throw new Error(`Cloudflare API: response missing 'result'`)\n }\n return response.result\n }\n return throwFetchError(resource, response)\n}\n\nexport const fetchSuccess = async (\n resource: string,\n init: RequestInit = {}\n): Promise => {\n const method = init.method ?? 'GET'\n const {cloudflareApiToken} = useInputs()\n\n const initFetch = {\n headers: {\n 'Content-Type': 'application/json;charset=UTF-8',\n Authorization: `Bearer ${cloudflareApiToken}`\n }\n }\n\n const response = (await fetch(resource, {\n method,\n ...initFetch\n }).then(response => response.json())) as FetchResult\n\n if (!response.success && response.errors.length > 0) {\n throwFetchError(resource, response)\n }\n\n return response.success\n}\n", "import type {PagesDeployment} from '../types.js'\n\nimport {useContext} from '../../github/context.js'\nimport {getCloudflareApiEndpoint} from '../api/endpoints.js'\nimport {fetchResult} from '../api/fetch-result.js'\n\nconst getCloudflareDeployments = async (): Promise> => {\n const url = getCloudflareApiEndpoint('deployments')\n\n const result = await fetchResult>(url)\n\n return result\n}\n\nexport const getCloudflareDeploymentAlias = (\n deployment: PagesDeployment\n): string => {\n return deployment.aliases && deployment.aliases.length > 0\n ? deployment.aliases[0]\n : deployment.url\n}\n\n/**\n * Get the latest deployment by commitHash.\n */\nexport const getCloudflareLatestDeployment =\n async (): Promise => {\n const {sha: commitHash} = useContext()\n\n const deployments = await getCloudflareDeployments()\n const deployment = deployments?.find(\n deployment =>\n deployment.deployment_trigger.metadata.commit_hash === commitHash\n )\n\n if (deployment === undefined) {\n throw new Error(\n `Cloudflare: could not find deployment with commitHash: ${commitHash}`\n )\n }\n\n return deployment\n }\n", "import {debug} from '@unlike/github-actions-core'\n\nimport type {PagesDeployment} from '../types.js'\n\nimport {getCloudflareLatestDeployment} from './get.js'\n\nconst ERROR_KEY = `Status Of Deployment:`\n\ntype DeploymentStatus = Exclude<\n PagesDeployment['stages'][number]['status'],\n 'idle'\n>\n\nexport const statusCloudflareDeployment = async (): Promise<{\n deployment: PagesDeployment\n status: DeploymentStatus\n}> => {\n let deploymentStatus: DeploymentStatus | 'unknown' = 'unknown'\n let deployment\n do {\n try {\n deployment = await getCloudflareLatestDeployment()\n const deployStage = deployment.stages.find(\n stage => stage.name === 'deploy'\n )\n\n debug(JSON.stringify(deployStage))\n\n switch (deployStage?.status) {\n case 'active':\n case 'success':\n case 'failure':\n case 'skipped':\n case 'canceled': {\n deploymentStatus = deployStage.status\n break\n }\n default: {\n await new Promise(resolve =>\n setTimeout(resolve, process.env.NODE_ENV === 'test' ? 1 : 1000)\n )\n }\n }\n } catch (error) {\n if (error instanceof Error) {\n throw error\n }\n if (\n error &&\n typeof error === 'object' &&\n 'stderr' in error &&\n typeof error.stderr === 'string'\n ) {\n throw new Error(error.stderr)\n }\n throw new Error(`${ERROR_KEY} unknown error`)\n }\n } while (deploymentStatus === 'unknown')\n\n return {deployment, status: deploymentStatus}\n}\n", "import type {Project} from '@cloudflare/types'\n\nimport {getCloudflareApiEndpoint} from '../api/endpoints.js'\nimport {fetchResult} from '../api/fetch-result.js'\n\n/**\n * Get Cloudfalre Pages project\n * https://developers.cloudflare.com/api/operations/pages-project-get-project\n */\nexport const getCloudflareProject = async (): Promise => {\n const url = getCloudflareApiEndpoint()\n\n const result = await fetchResult(url)\n\n return result\n}\n", "/* eslint-disable */\nimport type { DocumentTypeDecoration } from '@graphql-typed-document-node/core';\nexport type Maybe = T | null;\nexport type InputMaybe = Maybe;\nexport type Exact = { [K in keyof T]: T[K] };\nexport type MakeOptional = Omit & { [SubKey in K]?: Maybe };\nexport type MakeMaybe = Omit & { [SubKey in K]: Maybe };\nexport type MakeEmpty = { [_ in K]?: never };\nexport type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: { input: string; output: string; }\n String: { input: string; output: string; }\n Boolean: { input: boolean; output: boolean; }\n Int: { input: number; output: number; }\n Float: { input: number; output: number; }\n /** A (potentially binary) string encoded using base64. */\n Base64String: { input: any; output: any; }\n /**\n * Represents non-fractional signed whole numeric values. Since the value may\n * exceed the size of a 32-bit integer, it's encoded as a string.\n */\n BigInt: { input: any; output: any; }\n /** An ISO-8601 encoded date string. */\n Date: { input: any; output: any; }\n /** An ISO-8601 encoded UTC date string. */\n DateTime: { input: any; output: any; }\n /** A Git object ID. */\n GitObjectID: { input: any; output: any; }\n /** Git SSH string */\n GitSSHRemote: { input: any; output: any; }\n /** An ISO-8601 encoded date string. Unlike the DateTime type, GitTimestamp is not converted in UTC. */\n GitTimestamp: { input: any; output: any; }\n /** A string containing HTML code. */\n HTML: { input: any; output: any; }\n /** An ISO-8601 encoded UTC date string with millisecond precision. */\n PreciseDateTime: { input: any; output: any; }\n /** An RFC 3986, RFC 3987, and RFC 6570 (level 4) compliant URI string. */\n URI: { input: any; output: any; }\n /** A valid x509 certificate string */\n X509Certificate: { input: any; output: any; }\n};\n\n/** Autogenerated input type of AbortQueuedMigrations */\nexport type AbortQueuedMigrationsInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The ID of the organization that is running the migrations. */\n ownerId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of AbortQueuedMigrations */\nexport type AbortQueuedMigrationsPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** Did the operation succeed? */\n success?: Maybe;\n};\n\n/** Autogenerated input type of AbortRepositoryMigration */\nexport type AbortRepositoryMigrationInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The ID of the migration to be aborted. */\n migrationId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of AbortRepositoryMigration */\nexport type AbortRepositoryMigrationPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** Did the operation succeed? */\n success?: Maybe;\n};\n\n/** Autogenerated input type of AcceptEnterpriseAdministratorInvitation */\nexport type AcceptEnterpriseAdministratorInvitationInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The id of the invitation being accepted */\n invitationId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of AcceptEnterpriseAdministratorInvitation */\nexport type AcceptEnterpriseAdministratorInvitationPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The invitation that was accepted. */\n invitation?: Maybe;\n /** A message confirming the result of accepting an administrator invitation. */\n message?: Maybe;\n};\n\n/** Autogenerated input type of AcceptTopicSuggestion */\nexport type AcceptTopicSuggestionInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /**\n * The name of the suggested topic.\n *\n * **Upcoming Change on 2024-04-01 UTC**\n * **Description:** `name` will be removed.\n * **Reason:** Suggested topics are no longer supported\n */\n name?: InputMaybe;\n /**\n * The Node ID of the repository.\n *\n * **Upcoming Change on 2024-04-01 UTC**\n * **Description:** `repositoryId` will be removed.\n * **Reason:** Suggested topics are no longer supported\n */\n repositoryId?: InputMaybe;\n};\n\n/** Autogenerated return type of AcceptTopicSuggestion */\nexport type AcceptTopicSuggestionPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /**\n * The accepted topic.\n * @deprecated Suggested topics are no longer supported Removal on 2024-04-01 UTC.\n */\n topic?: Maybe;\n};\n\n/** Represents an object which can take actions on GitHub. Typically a User or Bot. */\nexport type Actor = {\n /** A URL pointing to the actor's public avatar. */\n avatarUrl: Scalars['URI']['output'];\n /** The username of the actor. */\n login: Scalars['String']['output'];\n /** The HTTP path for this actor. */\n resourcePath: Scalars['URI']['output'];\n /** The HTTP URL for this actor. */\n url: Scalars['URI']['output'];\n};\n\n\n/** Represents an object which can take actions on GitHub. Typically a User or Bot. */\nexport type ActorAvatarUrlArgs = {\n size?: InputMaybe;\n};\n\n/** Location information for an actor */\nexport type ActorLocation = {\n /** City */\n city?: Maybe;\n /** Country name */\n country?: Maybe;\n /** Country code */\n countryCode?: Maybe;\n /** Region name */\n region?: Maybe;\n /** Region or state code */\n regionCode?: Maybe;\n};\n\n/** The actor's type. */\nexport enum ActorType {\n /** Indicates a team actor. */\n Team = 'TEAM',\n /** Indicates a user actor. */\n User = 'USER'\n}\n\n/** Autogenerated input type of AddAssigneesToAssignable */\nexport type AddAssigneesToAssignableInput = {\n /** The id of the assignable object to add assignees to. */\n assignableId: Scalars['ID']['input'];\n /** The id of users to add as assignees. */\n assigneeIds: Array;\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n};\n\n/** Autogenerated return type of AddAssigneesToAssignable */\nexport type AddAssigneesToAssignablePayload = {\n /** The item that was assigned. */\n assignable?: Maybe;\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n};\n\n/** Autogenerated input type of AddComment */\nexport type AddCommentInput = {\n /** The contents of the comment. */\n body: Scalars['String']['input'];\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The Node ID of the subject to modify. */\n subjectId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of AddComment */\nexport type AddCommentPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The edge from the subject's comment connection. */\n commentEdge?: Maybe;\n /** The subject */\n subject?: Maybe;\n /** The edge from the subject's timeline connection. */\n timelineEdge?: Maybe;\n};\n\n/** Autogenerated input type of AddDiscussionComment */\nexport type AddDiscussionCommentInput = {\n /** The contents of the comment. */\n body: Scalars['String']['input'];\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The Node ID of the discussion to comment on. */\n discussionId: Scalars['ID']['input'];\n /** The Node ID of the discussion comment within this discussion to reply to. */\n replyToId?: InputMaybe;\n};\n\n/** Autogenerated return type of AddDiscussionComment */\nexport type AddDiscussionCommentPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The newly created discussion comment. */\n comment?: Maybe;\n};\n\n/** Autogenerated input type of AddDiscussionPollVote */\nexport type AddDiscussionPollVoteInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The Node ID of the discussion poll option to vote for. */\n pollOptionId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of AddDiscussionPollVote */\nexport type AddDiscussionPollVotePayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The poll option that a vote was added to. */\n pollOption?: Maybe;\n};\n\n/** Autogenerated input type of AddEnterpriseOrganizationMember */\nexport type AddEnterpriseOrganizationMemberInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The ID of the enterprise which owns the organization. */\n enterpriseId: Scalars['ID']['input'];\n /** The ID of the organization the users will be added to. */\n organizationId: Scalars['ID']['input'];\n /** The role to assign the users in the organization */\n role?: InputMaybe;\n /** The IDs of the enterprise members to add. */\n userIds: Array;\n};\n\n/** Autogenerated return type of AddEnterpriseOrganizationMember */\nexport type AddEnterpriseOrganizationMemberPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The users who were added to the organization. */\n users?: Maybe>;\n};\n\n/** Autogenerated input type of AddEnterpriseSupportEntitlement */\nexport type AddEnterpriseSupportEntitlementInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The ID of the Enterprise which the admin belongs to. */\n enterpriseId: Scalars['ID']['input'];\n /** The login of a member who will receive the support entitlement. */\n login: Scalars['String']['input'];\n};\n\n/** Autogenerated return type of AddEnterpriseSupportEntitlement */\nexport type AddEnterpriseSupportEntitlementPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** A message confirming the result of adding the support entitlement. */\n message?: Maybe;\n};\n\n/** Autogenerated input type of AddLabelsToLabelable */\nexport type AddLabelsToLabelableInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The ids of the labels to add. */\n labelIds: Array;\n /** The id of the labelable object to add labels to. */\n labelableId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of AddLabelsToLabelable */\nexport type AddLabelsToLabelablePayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The item that was labeled. */\n labelable?: Maybe;\n};\n\n/** Autogenerated input type of AddProjectCard */\nexport type AddProjectCardInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The content of the card. Must be a member of the ProjectCardItem union */\n contentId?: InputMaybe;\n /** The note on the card. */\n note?: InputMaybe;\n /** The Node ID of the ProjectColumn. */\n projectColumnId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of AddProjectCard */\nexport type AddProjectCardPayload = {\n /** The edge from the ProjectColumn's card connection. */\n cardEdge?: Maybe;\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The ProjectColumn */\n projectColumn?: Maybe;\n};\n\n/** Autogenerated input type of AddProjectColumn */\nexport type AddProjectColumnInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The name of the column. */\n name: Scalars['String']['input'];\n /** The Node ID of the project. */\n projectId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of AddProjectColumn */\nexport type AddProjectColumnPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The edge from the project's column connection. */\n columnEdge?: Maybe;\n /** The project */\n project?: Maybe;\n};\n\n/** Autogenerated input type of AddProjectV2DraftIssue */\nexport type AddProjectV2DraftIssueInput = {\n /** The IDs of the assignees of the draft issue. */\n assigneeIds?: InputMaybe>;\n /** The body of the draft issue. */\n body?: InputMaybe;\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The ID of the Project to add the draft issue to. */\n projectId: Scalars['ID']['input'];\n /**\n * The title of the draft issue. A project item can also be created by providing\n * the URL of an Issue or Pull Request if you have access.\n */\n title: Scalars['String']['input'];\n};\n\n/** Autogenerated return type of AddProjectV2DraftIssue */\nexport type AddProjectV2DraftIssuePayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The draft issue added to the project. */\n projectItem?: Maybe;\n};\n\n/** Autogenerated input type of AddProjectV2ItemById */\nexport type AddProjectV2ItemByIdInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The id of the Issue or Pull Request to add. */\n contentId: Scalars['ID']['input'];\n /** The ID of the Project to add the item to. */\n projectId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of AddProjectV2ItemById */\nexport type AddProjectV2ItemByIdPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The item added to the project. */\n item?: Maybe;\n};\n\n/** Autogenerated input type of AddPullRequestReviewComment */\nexport type AddPullRequestReviewCommentInput = {\n /**\n * The text of the comment. This field is required\n *\n * **Upcoming Change on 2023-10-01 UTC**\n * **Description:** `body` will be removed. use addPullRequestReviewThread or addPullRequestReviewThreadReply instead\n * **Reason:** We are deprecating the addPullRequestReviewComment mutation\n */\n body?: InputMaybe;\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /**\n * The SHA of the commit to comment on.\n *\n * **Upcoming Change on 2023-10-01 UTC**\n * **Description:** `commitOID` will be removed. use addPullRequestReviewThread or addPullRequestReviewThreadReply instead\n * **Reason:** We are deprecating the addPullRequestReviewComment mutation\n */\n commitOID?: InputMaybe;\n /**\n * The comment id to reply to.\n *\n * **Upcoming Change on 2023-10-01 UTC**\n * **Description:** `inReplyTo` will be removed. use addPullRequestReviewThread or addPullRequestReviewThreadReply instead\n * **Reason:** We are deprecating the addPullRequestReviewComment mutation\n */\n inReplyTo?: InputMaybe;\n /**\n * The relative path of the file to comment on.\n *\n * **Upcoming Change on 2023-10-01 UTC**\n * **Description:** `path` will be removed. use addPullRequestReviewThread or addPullRequestReviewThreadReply instead\n * **Reason:** We are deprecating the addPullRequestReviewComment mutation\n */\n path?: InputMaybe;\n /**\n * The line index in the diff to comment on.\n *\n * **Upcoming Change on 2023-10-01 UTC**\n * **Description:** `position` will be removed. use addPullRequestReviewThread or addPullRequestReviewThreadReply instead\n * **Reason:** We are deprecating the addPullRequestReviewComment mutation\n */\n position?: InputMaybe;\n /**\n * The node ID of the pull request reviewing\n *\n * **Upcoming Change on 2023-10-01 UTC**\n * **Description:** `pullRequestId` will be removed. use\n * addPullRequestReviewThread or addPullRequestReviewThreadReply instead\n * **Reason:** We are deprecating the addPullRequestReviewComment mutation\n */\n pullRequestId?: InputMaybe;\n /**\n * The Node ID of the review to modify.\n *\n * **Upcoming Change on 2023-10-01 UTC**\n * **Description:** `pullRequestReviewId` will be removed. use\n * addPullRequestReviewThread or addPullRequestReviewThreadReply instead\n * **Reason:** We are deprecating the addPullRequestReviewComment mutation\n */\n pullRequestReviewId?: InputMaybe;\n};\n\n/** Autogenerated return type of AddPullRequestReviewComment */\nexport type AddPullRequestReviewCommentPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The newly created comment. */\n comment?: Maybe;\n /** The edge from the review's comment connection. */\n commentEdge?: Maybe;\n};\n\n/** Autogenerated input type of AddPullRequestReview */\nexport type AddPullRequestReviewInput = {\n /** The contents of the review body comment. */\n body?: InputMaybe;\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /**\n * The review line comments.\n *\n * **Upcoming Change on 2023-10-01 UTC**\n * **Description:** `comments` will be removed. use the `threads` argument instead\n * **Reason:** We are deprecating comment fields that use diff-relative positioning\n */\n comments?: InputMaybe>>;\n /** The commit OID the review pertains to. */\n commitOID?: InputMaybe;\n /** The event to perform on the pull request review. */\n event?: InputMaybe;\n /** The Node ID of the pull request to modify. */\n pullRequestId: Scalars['ID']['input'];\n /** The review line comment threads. */\n threads?: InputMaybe>>;\n};\n\n/** Autogenerated return type of AddPullRequestReview */\nexport type AddPullRequestReviewPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The newly created pull request review. */\n pullRequestReview?: Maybe;\n /** The edge from the pull request's review connection. */\n reviewEdge?: Maybe;\n};\n\n/** Autogenerated input type of AddPullRequestReviewThread */\nexport type AddPullRequestReviewThreadInput = {\n /** Body of the thread's first comment. */\n body: Scalars['String']['input'];\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /**\n * The line of the blob to which the thread refers, required for line-level\n * threads. The end of the line range for multi-line comments.\n */\n line?: InputMaybe;\n /** Path to the file being commented on. */\n path: Scalars['String']['input'];\n /** The node ID of the pull request reviewing */\n pullRequestId?: InputMaybe;\n /** The Node ID of the review to modify. */\n pullRequestReviewId?: InputMaybe;\n /** The side of the diff on which the line resides. For multi-line comments, this is the side for the end of the line range. */\n side?: InputMaybe;\n /** The first line of the range to which the comment refers. */\n startLine?: InputMaybe;\n /** The side of the diff on which the start line resides. */\n startSide?: InputMaybe;\n /** The level at which the comments in the corresponding thread are targeted, can be a diff line or a file */\n subjectType?: InputMaybe;\n};\n\n/** Autogenerated return type of AddPullRequestReviewThread */\nexport type AddPullRequestReviewThreadPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The newly created thread. */\n thread?: Maybe;\n};\n\n/** Autogenerated input type of AddPullRequestReviewThreadReply */\nexport type AddPullRequestReviewThreadReplyInput = {\n /** The text of the reply. */\n body: Scalars['String']['input'];\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The Node ID of the pending review to which the reply will belong. */\n pullRequestReviewId?: InputMaybe;\n /** The Node ID of the thread to which this reply is being written. */\n pullRequestReviewThreadId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of AddPullRequestReviewThreadReply */\nexport type AddPullRequestReviewThreadReplyPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The newly created reply. */\n comment?: Maybe;\n};\n\n/** Autogenerated input type of AddReaction */\nexport type AddReactionInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The name of the emoji to react with. */\n content: ReactionContent;\n /** The Node ID of the subject to modify. */\n subjectId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of AddReaction */\nexport type AddReactionPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The reaction object. */\n reaction?: Maybe;\n /** The reaction groups for the subject. */\n reactionGroups?: Maybe>;\n /** The reactable subject. */\n subject?: Maybe;\n};\n\n/** Autogenerated input type of AddStar */\nexport type AddStarInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The Starrable ID to star. */\n starrableId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of AddStar */\nexport type AddStarPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The starrable. */\n starrable?: Maybe;\n};\n\n/** Autogenerated input type of AddUpvote */\nexport type AddUpvoteInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The Node ID of the discussion or comment to upvote. */\n subjectId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of AddUpvote */\nexport type AddUpvotePayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The votable subject. */\n subject?: Maybe;\n};\n\n/** Autogenerated input type of AddVerifiableDomain */\nexport type AddVerifiableDomainInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The URL of the domain */\n domain: Scalars['URI']['input'];\n /** The ID of the owner to add the domain to */\n ownerId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of AddVerifiableDomain */\nexport type AddVerifiableDomainPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The verifiable domain that was added. */\n domain?: Maybe;\n};\n\n/** Represents an 'added_to_merge_queue' event on a given pull request. */\nexport type AddedToMergeQueueEvent = Node & {\n /** Identifies the actor who performed the event. */\n actor?: Maybe;\n /** Identifies the date and time when the object was created. */\n createdAt: Scalars['DateTime']['output'];\n /** The user who added this Pull Request to the merge queue */\n enqueuer?: Maybe;\n /** The Node ID of the AddedToMergeQueueEvent object */\n id: Scalars['ID']['output'];\n /** The merge queue where this pull request was added to. */\n mergeQueue?: Maybe;\n /** PullRequest referenced by event. */\n pullRequest?: Maybe;\n};\n\n/** Represents a 'added_to_project' event on a given issue or pull request. */\nexport type AddedToProjectEvent = Node & {\n /** Identifies the actor who performed the event. */\n actor?: Maybe;\n /** Identifies the date and time when the object was created. */\n createdAt: Scalars['DateTime']['output'];\n /** Identifies the primary key from the database. */\n databaseId?: Maybe;\n /** The Node ID of the AddedToProjectEvent object */\n id: Scalars['ID']['output'];\n};\n\n/** Represents an announcement banner. */\nexport type AnnouncementBanner = {\n /** The text of the announcement */\n announcement?: Maybe;\n /** The expiration date of the announcement, if any */\n announcementExpiresAt?: Maybe;\n /** Whether the announcement can be dismissed by the user */\n announcementUserDismissible?: Maybe;\n};\n\n/** A GitHub App. */\nexport type App = Node & {\n /** Identifies the date and time when the object was created. */\n createdAt: Scalars['DateTime']['output'];\n /** Identifies the primary key from the database. */\n databaseId?: Maybe;\n /** The description of the app. */\n description?: Maybe;\n /** The Node ID of the App object */\n id: Scalars['ID']['output'];\n /** The IP addresses of the app. */\n ipAllowListEntries: IpAllowListEntryConnection;\n /** The hex color code, without the leading '#', for the logo background. */\n logoBackgroundColor: Scalars['String']['output'];\n /** A URL pointing to the app's logo. */\n logoUrl: Scalars['URI']['output'];\n /** The name of the app. */\n name: Scalars['String']['output'];\n /** A slug based on the name of the app for use in URLs. */\n slug: Scalars['String']['output'];\n /** Identifies the date and time when the object was last updated. */\n updatedAt: Scalars['DateTime']['output'];\n /** The URL to the app's homepage. */\n url: Scalars['URI']['output'];\n};\n\n\n/** A GitHub App. */\nexport type AppIpAllowListEntriesArgs = {\n after?: InputMaybe;\n before?: InputMaybe;\n first?: InputMaybe;\n last?: InputMaybe;\n orderBy?: InputMaybe;\n};\n\n\n/** A GitHub App. */\nexport type AppLogoUrlArgs = {\n size?: InputMaybe;\n};\n\n/** Autogenerated input type of ApproveDeployments */\nexport type ApproveDeploymentsInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** Optional comment for approving deployments */\n comment?: InputMaybe;\n /** The ids of environments to reject deployments */\n environmentIds: Array;\n /** The node ID of the workflow run containing the pending deployments. */\n workflowRunId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of ApproveDeployments */\nexport type ApproveDeploymentsPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The affected deployments. */\n deployments?: Maybe>;\n};\n\n/** Autogenerated input type of ApproveVerifiableDomain */\nexport type ApproveVerifiableDomainInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The ID of the verifiable domain to approve. */\n id: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of ApproveVerifiableDomain */\nexport type ApproveVerifiableDomainPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The verifiable domain that was approved. */\n domain?: Maybe;\n};\n\n/** Autogenerated input type of ArchiveProjectV2Item */\nexport type ArchiveProjectV2ItemInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The ID of the ProjectV2Item to archive. */\n itemId: Scalars['ID']['input'];\n /** The ID of the Project to archive the item from. */\n projectId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of ArchiveProjectV2Item */\nexport type ArchiveProjectV2ItemPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The item archived from the project. */\n item?: Maybe;\n};\n\n/** Autogenerated input type of ArchiveRepository */\nexport type ArchiveRepositoryInput = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: InputMaybe;\n /** The ID of the repository to mark as archived. */\n repositoryId: Scalars['ID']['input'];\n};\n\n/** Autogenerated return type of ArchiveRepository */\nexport type ArchiveRepositoryPayload = {\n /** A unique identifier for the client performing the mutation. */\n clientMutationId?: Maybe;\n /** The repository that was marked as archived. */\n repository?: Maybe;\n};\n\n/** An object that can have users assigned to it. */\nexport type Assignable = {\n /** A list of Users assigned to this object. */\n assignees: UserConnection;\n};\n\n\n/** An object that can have users assigned to it. */\nexport type AssignableAssigneesArgs = {\n after?: InputMaybe;\n before?: InputMaybe;\n first?: InputMaybe;\n last?: InputMaybe;\n};\n\n/** Represents an 'assigned' event on any assignable object. */\nexport type AssignedEvent = Node & {\n /** Identifies the actor who performed the event. */\n actor?: Maybe;\n /** Identifies the assignable associated with the event. */\n assignable: Assignable;\n /** Identifies the user or mannequin that was assigned. */\n assignee?: Maybe;\n /** Identifies the date and time when the object was created. */\n createdAt: Scalars['DateTime']['output'];\n /** The Node ID of the AssignedEvent object */\n id: Scalars['ID']['output'];\n /**\n * Identifies the user who was assigned.\n * @deprecated Assignees can now be mannequins. Use the `assignee` field instead. Removal on 2020-01-01 UTC.\n */\n user?: Maybe;\n};\n\n/** Types that can be assigned to issues. */\nexport type Assignee = Bot | Mannequin | Organization | User;\n\n/** An entry in the audit log. */\nexport type AuditEntry = {\n /** The action name */\n action: Scalars['String']['output'];\n /** The user who initiated the action */\n actor?: Maybe;\n /** The IP address of the actor */\n actorIp?: Maybe;\n /** A readable representation of the actor's location */\n actorLocation?: Maybe;\n /** The username of the user who initiated the action */\n actorLogin?: Maybe;\n /** The HTTP path for the actor. */\n actorResourcePath?: Maybe;\n /** The HTTP URL for the actor. */\n actorUrl?: Maybe;\n /** The time the action was initiated */\n createdAt: Scalars['PreciseDateTime']['output'];\n /** The corresponding operation type for the action */\n operationType?: Maybe;\n /** The user affected by the action */\n user?: Maybe;\n /** For actions involving two users, the actor is the initiator and the user is the affected user. */\n userLogin?: Maybe;\n /** The HTTP path for the user. */\n userResourcePath?: Maybe;\n /** The HTTP URL for the user. */\n userUrl?: Maybe;\n};\n\n/** Types that can initiate an audit log event. */\nexport type AuditEntryActor = Bot | Organization | User;\n\n/** Ordering options for Audit Log connections. */\nexport type AuditLogOrder = {\n /** The ordering direction. */\n direction?: InputMaybe;\n /** The field to order Audit Logs by. */\n field?: InputMaybe;\n};\n\n/** Properties by which Audit Log connections can be ordered. */\nexport enum AuditLogOrderField {\n /** Order audit log entries by timestamp */\n CreatedAt = 'CREATED_AT'\n}\n\n/** Represents a 'auto_merge_disabled' event on a given pull request. */\nexport type AutoMergeDisabledEvent = Node & {\n /** Identifies the actor who performed the event. */\n actor?: Maybe;\n /** Identifies the date and time when the object was created. */\n createdAt: Scalars['DateTime']['output'];\n /** The user who disabled auto-merge for this Pull Request */\n disabler?: Maybe;\n /** The Node ID of the AutoMergeDisabledEvent object */\n id: Scalars['ID']['output'];\n /** PullRequest referenced by event */\n pullRequest?: Maybe;\n /** The reason auto-merge was disabled */\n reason?: Maybe;\n /** The reason_code relating to why auto-merge was disabled */\n reasonCode?: Maybe;\n};\n\n/** Represents a 'auto_merge_enabled' event on a given pull request. */\nexport type AutoMergeEnabledEvent = Node & {\n /** Identifies the actor who performed the event. */\n actor?: Maybe;\n /** Identifies the date and time when the object was created. */\n createdAt: Scalars['DateTime']['output'];\n /** The user who enabled auto-merge for this Pull Request */\n enabler?: Maybe;\n /** The Node ID of the AutoMergeEnabledEvent object */\n id: Scalars['ID']['output'];\n /** PullRequest referenced by event. */\n pullRequest?: Maybe;\n};\n\n/** Represents an auto-merge request for a pull request */\nexport type AutoMergeRequest = {\n /** The email address of the author of this auto-merge request. */\n authorEmail?: Maybe;\n /**\n * The commit message of the auto-merge request. If a merge queue is required by\n * the base branch, this value will be set by the merge queue when merging.\n */\n commitBody?: Maybe;\n /**\n * The commit title of the auto-merge request. If a merge queue is required by\n * the base branch, this value will be set by the merge queue when merging\n */\n commitHeadline?: Maybe;\n /** When was this auto-merge request was enabled. */\n enabledAt?: Maybe;\n /** The actor who created the auto-merge request. */\n enabledBy?: Maybe;\n /**\n * The merge method of the auto-merge request. If a merge queue is required by\n * the base branch, this value will be set by the merge queue when merging.\n */\n mergeMethod: PullRequestMergeMethod;\n /** The pull request that this auto-merge request is set against. */\n pullRequest: PullRequest;\n};\n\n/** Represents a 'auto_rebase_enabled' event on a given pull request. */\nexport type AutoRebaseEnabledEvent = Node & {\n /** Identifies the actor who performed the event. */\n actor?: Maybe;\n /** Identifies the date and time when the object was created. */\n createdAt: Scalars['DateTime']['output'];\n /** The user who enabled auto-merge (rebase) for this Pull Request */\n enabler?: Maybe;\n /** The Node ID of the AutoRebaseEnabledEvent object */\n id: Scalars['ID']['output'];\n /** PullRequest referenced by event. */\n pullRequest?: Maybe;\n};\n\n/** Represents a 'auto_squash_enabled' event on a given pull request. */\nexport type AutoSquashEnabledEvent = Node & {\n /** Identifies the actor who performed the event. */\n actor?: Maybe;\n /** Identifies the date and time when the object was created. */\n createdAt: Scalars['DateTime']['output'];\n /** The user who enabled auto-merge (squash) for this Pull Request */\n enabler?: Maybe;\n /** The Node ID of the AutoSquashEnabledEvent object */\n id: Scalars['ID']['output'];\n /** PullRequest referenced by event. */\n pullRequest?: Maybe;\n};\n\n/** Represents a 'automatic_base_change_failed' event on a given pull request. */\nexport type AutomaticBaseChangeFailedEvent = Node & {\n /** Identifies the actor who performed the event. */\n actor?: Maybe;\n /** Identifies the date and time when the object was created. */\n createdAt: Scalars['DateTime']['output'];\n /** The Node ID of the AutomaticBaseChangeFailedEvent object */\n id: Scalars['ID']['output'];\n /** The new base for this PR */\n newBase: Scalars['String']['output'];\n /** The old base for this PR */\n oldBase: Scalars['String']['output'];\n /** PullRequest referenced by event. */\n pullRequest: PullRequest;\n};\n\n/** Represents a 'automatic_base_change_succeeded' event on a given pull request. */\nexport type AutomaticBaseChangeSucceededEvent = Node & {\n /** Identifies the actor who performed the event. */\n actor?: Maybe;\n /** Identifies the date and time when the object was created. */\n createdAt: Scalars['DateTime']['output'];\n /** The Node ID of the AutomaticBaseChangeSucceededEvent object */\n id: Scalars['ID']['output'];\n /** The new base for this PR */\n newBase: Scalars['String']['output'];\n /** The old base for this PR */\n oldBase: Scalars['String']['output'];\n /** PullRequest referenced by event. */\n pullRequest: PullRequest;\n};\n\n/** Represents a 'base_ref_changed' event on a given issue or pull request. */\nexport type BaseRefChangedEvent = Node & {\n /** Identifies the actor who performed the event. */\n actor?: Maybe;\n /** Identifies the date and time when the object was created. */\n createdAt: Scalars['DateTime']['output'];\n /** Identifies the name of the base ref for the pull request after it was changed. */\n currentRefName: Scalars['String']['output'];\n /** Identifies the primary key from the database. */\n databaseId?: Maybe;\n /** The Node ID of the BaseRefChangedEvent object */\n id: Scalars['ID']['output'];\n /** Identifies the name of the base ref for the pull request before it was changed. */\n previousRefName: Scalars['String']['output'];\n /** PullRequest referenced by event. */\n pullRequest: PullRequest;\n};\n\n/** Represents a 'base_ref_deleted' event on a given pull request. */\nexport type BaseRefDeletedEvent = Node & {\n /** Identifies the actor who performed the event. */\n actor?: Maybe;\n /** Identifies the name of the Ref associated with the `base_ref_deleted` event. */\n baseRefName?: Maybe;\n /** Identifies the date and time when the object was created. */\n createdAt: Scalars['DateTime']['output'];\n /** The Node ID of the BaseRefDeletedEvent object */\n id: Scalars['ID']['output'];\n /** PullRequest referenced by event. */\n pullRequest?: Maybe;\n};\n\n/** Represents a 'base_ref_force_pushed' event on a given pull request. */\nexport type BaseRefForcePushedEvent = Node & {\n /** Identifies the actor who performed the event. */\n actor?: Maybe;\n /** Identifies the after commit SHA for the 'base_ref_force_pushed' event. */\n afterCommit?: Maybe;\n /** Identifies the before commit SHA for the 'base_ref_force_pushed' event. */\n beforeCommit?: Maybe;\n /** Identifies the date and time when the object was created. */\n createdAt: Scalars['DateTime']['output'];\n /** The Node ID of the BaseRefForcePushedEvent object */\n id: Scalars['ID']['output'];\n /** PullRequest referenced by event. */\n pullRequest: PullRequest;\n /** Identifies the fully qualified ref name for the 'base_ref_force_pushed' event. */\n ref?: Maybe[;\n};\n\n/** Represents a Git blame. */\nexport type Blame = {\n /** The list of ranges from a Git blame. */\n ranges: Array;\n};\n\n/** Represents a range of information from a Git blame. */\nexport type BlameRange = {\n /**\n * Identifies the recency of the change, from 1 (new) to 10 (old). This is\n * calculated as a 2-quantile and determines the length of distance between the\n * median age of all the changes in the file and the recency of the current\n * range's change.\n */\n age: Scalars['Int']['output'];\n /** Identifies the line author */\n commit: Commit;\n /** The ending line for the range */\n endingLine: Scalars['Int']['output'];\n /** The starting line for the range */\n startingLine: Scalars['Int']['output'];\n};\n\n/** Represents a Git blob. */\nexport type Blob = GitObject & Node & {\n /** An abbreviated version of the Git object ID */\n abbreviatedOid: Scalars['String']['output'];\n /** Byte size of Blob object */\n byteSize: Scalars['Int']['output'];\n /** The HTTP path for this Git object */\n commitResourcePath: Scalars['URI']['output'];\n /** The HTTP URL for this Git object */\n commitUrl: Scalars['URI']['output'];\n /** The Node ID of the Blob object */\n id: Scalars['ID']['output'];\n /** Indicates whether the Blob is binary or text. Returns null if unable to determine the encoding. */\n isBinary?: Maybe;\n /** Indicates whether the contents is truncated */\n isTruncated: Scalars['Boolean']['output'];\n /** The Git object ID */\n oid: Scalars['GitObjectID']['output'];\n /** The Repository the Git object belongs to */\n repository: Repository;\n /** UTF8 text data or null if the Blob is binary */\n text?: Maybe;\n};\n\n/** A special type of user which takes actions on behalf of GitHub Apps. */\nexport type Bot = Actor & Node & UniformResourceLocatable & {\n /** A URL pointing to the GitHub App's public avatar. */\n avatarUrl: Scalars['URI']['output'];\n /** Identifies the date and time when the object was created. */\n createdAt: Scalars['DateTime']['output'];\n /** Identifies the primary key from the database. */\n databaseId?: Maybe;\n /** The Node ID of the Bot object */\n id: Scalars['ID']['output'];\n /** The username of the actor. */\n login: Scalars['String']['output'];\n /** The HTTP path for this bot */\n resourcePath: Scalars['URI']['output'];\n /** Identifies the date and time when the object was last updated. */\n updatedAt: Scalars['DateTime']['output'];\n /** The HTTP URL for this bot */\n url: Scalars['URI']['output'];\n};\n\n\n/** A special type of user which takes actions on behalf of GitHub Apps. */\nexport type BotAvatarUrlArgs = {\n size?: InputMaybe;\n};\n\n/** Types which can be actors for `BranchActorAllowance` objects. */\nexport type BranchActorAllowanceActor = App | Team | User;\n\n/** Parameters to be used for the branch_name_pattern rule */\nexport type BranchNamePatternParameters = {\n /** How this rule will appear to users. */\n name?: Maybe;\n /** If true, the rule will fail if the pattern matches. */\n negate: Scalars['Boolean']['output'];\n /** The operator to use for matching. */\n operator: Scalars['String']['output'];\n /** The pattern to match with. */\n pattern: Scalars['String']['output'];\n};\n\n/** Parameters to be used for the branch_name_pattern rule */\nexport type BranchNamePatternParametersInput = {\n /** How this rule will appear to users. */\n name?: InputMaybe;\n /** If true, the rule will fail if the pattern matches. */\n negate?: InputMaybe;\n /** The operator to use for matching. */\n operator: Scalars['String']['input'];\n /** The pattern to match with. */\n pattern: Scalars['String']['input'];\n};\n\n/** A branch protection rule. */\nexport type BranchProtectionRule = Node & {\n /** Can this branch be deleted. */\n allowsDeletions: Scalars['Boolean']['output'];\n /** Are force pushes allowed on this branch. */\n allowsForcePushes: Scalars['Boolean']['output'];\n /** Is branch creation a protected operation. */\n blocksCreations: Scalars['Boolean']['output'];\n /** A list of conflicts matching branches protection rule and other branch protection rules */\n branchProtectionRuleConflicts: BranchProtectionRuleConflictConnection;\n /** A list of actors able to force push for this branch protection rule. */\n bypassForcePushAllowances: BypassForcePushAllowanceConnection;\n /** A list of actors able to bypass PRs for this branch protection rule. */\n bypassPullRequestAllowances: BypassPullRequestAllowanceConnection;\n /** The actor who created this branch protection rule. */\n creator?: Maybe;\n /** Identifies the primary key from the database. */\n databaseId?: Maybe;\n /** Will new commits pushed to matching branches dismiss pull request review approvals. */\n dismissesStaleReviews: Scalars['Boolean']['output'];\n /** The Node ID of the BranchProtectionRule object */\n id: Scalars['ID']['output'];\n /** Can admins override branch protection. */\n isAdminEnforced: Scalars['Boolean']['output'];\n /**\n * Whether users can pull changes from upstream when the branch is locked. Set to\n * `true` to allow fork syncing. Set to `false` to prevent fork syncing.\n */\n lockAllowsFetchAndMerge: Scalars['Boolean']['output'];\n /** Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. */\n lockBranch: Scalars['Boolean']['output'];\n /** Repository refs that are protected by this rule */\n matchingRefs: RefConnection;\n /** Identifies the protection rule pattern. */\n pattern: Scalars['String']['output'];\n /** A list push allowances for this branch protection rule. */\n pushAllowances: PushAllowanceConnection;\n /** The repository associated with this branch protection rule. */\n repository?: Maybe;\n /** Whether the most recent push must be approved by someone other than the person who pushed it */\n requireLastPushApproval: Scalars['Boolean']['output'];\n /** Number of approving reviews required to update matching branches. */\n requiredApprovingReviewCount?: Maybe;\n /** List of required deployment environments that must be deployed successfully to update matching branches */\n requiredDeploymentEnvironments?: Maybe>>;\n /** List of required status check contexts that must pass for commits to be accepted to matching branches. */\n requiredStatusCheckContexts?: Maybe>>;\n /** List of required status checks that must pass for commits to be accepted to matching branches. */\n requiredStatusChecks?: Maybe>;\n /** Are approving reviews required to update matching branches. */\n requiresApprovingReviews: Scalars['Boolean']['output'];\n /** Are reviews from code owners required to update matching branches. */\n requiresCodeOwnerReviews: Scalars['Boolean']['output'];\n /** Are commits required to be signed. */\n requiresCommitSignatures: Scalars['Boolean']['output'];\n /** Are conversations required to be resolved before merging. */\n requiresConversationResolution: Scalars['Boolean']['output'];\n /** Does this branch require deployment to specific environments before merging */\n requiresDeployments: Scalars['Boolean']['output'];\n /** Are merge commits prohibited from being pushed to this branch. */\n requiresLinearHistory: Scalars['Boolean']['output'];\n /** Are status checks required to update matching branches. */\n requiresStatusChecks: Scalars['Boolean']['output'];\n /** Are branches required to be up to date before merging. */\n requiresStrictStatusChecks: Scalars['Boolean']['output'];\n /** Is pushing to matching branches restricted. */\n restrictsPushes: Scalars['Boolean']['output'];\n /** Is dismissal of pull request reviews restricted. */\n restrictsReviewDismissals: Scalars['Boolean']['output'];\n /** A list review dismissal allowances for this branch protection rule. */\n reviewDismissalAllowances: ReviewDismissalAllowanceConnection;\n};\n\n\n/** A branch protection rule. */\nexport type BranchProtectionRuleBranchProtectionRuleConflictsArgs = {\n after?: InputMaybe;\n before?: InputMaybe;\n first?: InputMaybe;\n last?: InputMaybe;\n};\n\n\n/** A branch protection rule. */\nexport type BranchProtectionRuleBypassForcePushAllowancesArgs = {\n after?: InputMaybe;\n before?: InputMaybe;\n first?: InputMaybe;\n last?: InputMaybe]