@ -1940,7 +1940,7 @@ var require_path_utils = __commonJS({
} ;
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
exports . toPlatformPath = exports . toWin32Path = exports . toPosixPath = void 0 ;
exports . toPlatformPath = exports . toWin32Path = exports . toPosixPath = void 0 ;
var path 2 = _ _importStar ( require ( "path" ) ) ;
var path 3 = _ _importStar ( require ( "path" ) ) ;
function toPosixPath ( pth ) {
function toPosixPath ( pth ) {
return pth . replace ( /[\\]/g , "/" ) ;
return pth . replace ( /[\\]/g , "/" ) ;
}
}
@ -1950,7 +1950,7 @@ var require_path_utils = __commonJS({
}
}
exports . toWin32Path = toWin32Path ;
exports . toWin32Path = toWin32Path ;
function toPlatformPath ( pth ) {
function toPlatformPath ( pth ) {
return pth . replace ( /[/\\]/g , path 2 . sep ) ;
return pth . replace ( /[/\\]/g , path 3 . sep ) ;
}
}
exports . toPlatformPath = toPlatformPath ;
exports . toPlatformPath = toPlatformPath ;
}
}
@ -2021,7 +2021,7 @@ var require_core = __commonJS({
var file _command _1 = require _file _command ( ) ;
var file _command _1 = require _file _command ( ) ;
var utils _1 = require _utils ( ) ;
var utils _1 = require _utils ( ) ;
var os = _ _importStar ( require ( "os" ) ) ;
var os = _ _importStar ( require ( "os" ) ) ;
var path 2 = _ _importStar ( require ( "path" ) ) ;
var path 3 = _ _importStar ( require ( "path" ) ) ;
var oidc _utils _1 = require _oidc _utils ( ) ;
var oidc _utils _1 = require _oidc _utils ( ) ;
var ExitCode ;
var ExitCode ;
( function ( ExitCode2 ) {
( function ( ExitCode2 ) {
@ -2049,7 +2049,7 @@ var require_core = __commonJS({
} else {
} else {
command _1 . issueCommand ( "add-path" , { } , inputPath ) ;
command _1 . issueCommand ( "add-path" , { } , inputPath ) ;
}
}
process . env [ "PATH" ] = ` ${ inputPath } ${ path 2 . delimiter } ${ process . env [ "PATH" ] } ` ;
process . env [ "PATH" ] = ` ${ inputPath } ${ path 3 . delimiter } ${ process . env [ "PATH" ] } ` ;
}
}
exports . addPath = addPath ;
exports . addPath = addPath ;
function getInput2 ( name , options ) {
function getInput2 ( name , options ) {
@ -2201,8 +2201,8 @@ var require_context = __commonJS({
if ( fs _1 . existsSync ( process . env . GITHUB _EVENT _PATH ) ) {
if ( fs _1 . existsSync ( process . env . GITHUB _EVENT _PATH ) ) {
this . payload = JSON . parse ( fs _1 . readFileSync ( process . env . GITHUB _EVENT _PATH , { encoding : "utf8" } ) ) ;
this . payload = JSON . parse ( fs _1 . readFileSync ( process . env . GITHUB _EVENT _PATH , { encoding : "utf8" } ) ) ;
} else {
} else {
const path 2 = process . env . GITHUB _EVENT _PATH ;
const path 3 = process . env . GITHUB _EVENT _PATH ;
process . stdout . write ( ` GITHUB_EVENT_PATH ${ path 2 } does not exist ${ os _1 . EOL } ` ) ;
process . stdout . write ( ` GITHUB_EVENT_PATH ${ path 3 } does not exist ${ os _1 . EOL } ` ) ;
}
}
}
}
this . eventName = process . env . GITHUB _EVENT _NAME ;
this . eventName = process . env . GITHUB _EVENT _NAME ;
@ -3520,14 +3520,14 @@ var require_url_state_machine = __commonJS({
return url . replace ( /\u0009|\u000A|\u000D/g , "" ) ;
return url . replace ( /\u0009|\u000A|\u000D/g , "" ) ;
}
}
function shortenPath ( url ) {
function shortenPath ( url ) {
const path 2 = url . path ;
const path 3 = url . path ;
if ( path 2 . length === 0 ) {
if ( path 3 . length === 0 ) {
return ;
return ;
}
}
if ( url . scheme === "file" && path 2 . length === 1 && isNormalizedWindowsDriveLetter ( path 2 [ 0 ] ) ) {
if ( url . scheme === "file" && path 3 . length === 1 && isNormalizedWindowsDriveLetter ( path 3 [ 0 ] ) ) {
return ;
return ;
}
}
path 2 . pop ( ) ;
path 3 . pop ( ) ;
}
}
function includesCredentials ( url ) {
function includesCredentials ( url ) {
return url . username !== "" || url . password !== "" ;
return url . username !== "" || url . password !== "" ;
@ -7857,14 +7857,14 @@ var require_util = __commonJS({
if ( ! ( url instanceof URL ) ) {
if ( ! ( url instanceof URL ) ) {
const port = url . port != null ? url . port : url . protocol === "https:" ? 443 : 80 ;
const port = url . port != null ? url . port : url . protocol === "https:" ? 443 : 80 ;
let origin = url . origin != null ? url . origin : ` ${ url . protocol } // ${ url . hostname } : ${ port } ` ;
let origin = url . origin != null ? url . origin : ` ${ url . protocol } // ${ url . hostname } : ${ port } ` ;
let path 2 = url . path != null ? url . path : ` ${ url . pathname || "" } ${ url . search || "" } ` ;
let path 3 = url . path != null ? url . path : ` ${ url . pathname || "" } ${ url . search || "" } ` ;
if ( origin . endsWith ( "/" ) ) {
if ( origin . endsWith ( "/" ) ) {
origin = origin . substring ( 0 , origin . length - 1 ) ;
origin = origin . substring ( 0 , origin . length - 1 ) ;
}
}
if ( path 2 && ! path2 . startsWith ( "/" ) ) {
if ( path 3 && ! path3 . startsWith ( "/" ) ) {
path 2 = ` / ${ path2 } ` ;
path 3 = ` / ${ path3 } ` ;
}
}
url = new URL ( origin + path 2 ) ;
url = new URL ( origin + path 3 ) ;
}
}
return url ;
return url ;
}
}
@ -8471,18 +8471,18 @@ var require_utils5 = __commonJS({
if ( decode )
if ( decode )
return decode ( data , hint ) ;
return decode ( data , hint ) ;
}
}
function basename ( path 2 ) {
function basename ( path 3 ) {
if ( typeof path 2 !== "string" )
if ( typeof path 3 !== "string" )
return "" ;
return "" ;
for ( let i = path 2 . length - 1 ; i >= 0 ; -- i ) {
for ( let i = path 3 . length - 1 ; i >= 0 ; -- i ) {
switch ( path 2 . charCodeAt ( i ) ) {
switch ( path 3 . charCodeAt ( i ) ) {
case 47 :
case 47 :
case 92 :
case 92 :
path 2 = path2 . slice ( i + 1 ) ;
path 3 = path3 . slice ( i + 1 ) ;
return path 2 === ".." || path2 === "." ? "" : path2 ;
return path 3 === ".." || path3 === "." ? "" : path3 ;
}
}
}
}
return path 2 === ".." || path2 === "." ? "" : path2 ;
return path 3 === ".." || path3 === "." ? "" : path3 ;
}
}
var TOKEN = [
var TOKEN = [
0 ,
0 ,
@ -13522,7 +13522,7 @@ var require_request = __commonJS({
}
}
var Request = class {
var Request = class {
constructor ( origin , {
constructor ( origin , {
path : path 2 ,
path : path 3 ,
method ,
method ,
body ,
body ,
headers ,
headers ,
@ -13534,11 +13534,11 @@ var require_request = __commonJS({
bodyTimeout ,
bodyTimeout ,
throwOnError
throwOnError
} , handler ) {
} , handler ) {
if ( typeof path 2 !== "string" ) {
if ( typeof path 3 !== "string" ) {
throw new InvalidArgumentError ( "path must be a string" ) ;
throw new InvalidArgumentError ( "path must be a string" ) ;
} else if ( path 2 [ 0 ] !== "/" && ! ( path 2. startsWith ( "http://" ) || path2 . startsWith ( "https://" ) ) && method !== "CONNECT" ) {
} else if ( path 3 [ 0 ] !== "/" && ! ( path 3. startsWith ( "http://" ) || path3 . startsWith ( "https://" ) ) && method !== "CONNECT" ) {
throw new InvalidArgumentError ( "path must be an absolute URL or start with a slash" ) ;
throw new InvalidArgumentError ( "path must be an absolute URL or start with a slash" ) ;
} else if ( invalidPathRegex . exec ( path 2 ) !== null ) {
} else if ( invalidPathRegex . exec ( path 3 ) !== null ) {
throw new InvalidArgumentError ( "invalid request path" ) ;
throw new InvalidArgumentError ( "invalid request path" ) ;
}
}
if ( typeof method !== "string" ) {
if ( typeof method !== "string" ) {
@ -13579,7 +13579,7 @@ var require_request = __commonJS({
this . completed = false ;
this . completed = false ;
this . aborted = false ;
this . aborted = false ;
this . upgrade = upgrade || null ;
this . upgrade = upgrade || null ;
this . path = query ? util . buildURL ( path 2, query ) : path2 ;
this . path = query ? util . buildURL ( path 3, query ) : path3 ;
this . origin = origin ;
this . origin = origin ;
this . idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent ;
this . idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent ;
this . blocking = blocking == null ? false : blocking ;
this . blocking = blocking == null ? false : blocking ;
@ -14426,9 +14426,9 @@ var require_RedirectHandler = __commonJS({
return this . handler . onHeaders ( statusCode , headers , resume , statusText ) ;
return this . handler . onHeaders ( statusCode , headers , resume , statusText ) ;
}
}
const { origin , pathname , search } = util . parseURL ( new URL ( this . location , this . opts . origin && new URL ( this . opts . path , this . opts . origin ) ) ) ;
const { origin , pathname , search } = util . parseURL ( new URL ( this . location , this . opts . origin && new URL ( this . opts . path , this . opts . origin ) ) ) ;
const path 2 = search ? ` ${ pathname } ${ search } ` : pathname ;
const path 3 = search ? ` ${ pathname } ${ search } ` : pathname ;
this . opts . headers = cleanRequestHeaders ( this . opts . headers , statusCode === 303 , this . opts . origin !== origin ) ;
this . opts . headers = cleanRequestHeaders ( this . opts . headers , statusCode === 303 , this . opts . origin !== origin ) ;
this . opts . path = path 2 ;
this . opts . path = path 3 ;
this . opts . origin = origin ;
this . opts . origin = origin ;
this . opts . maxRedirections = 0 ;
this . opts . maxRedirections = 0 ;
if ( statusCode === 303 && this . opts . method !== "HEAD" ) {
if ( statusCode === 303 && this . opts . method !== "HEAD" ) {
@ -15503,7 +15503,7 @@ var require_client = __commonJS({
}
}
}
}
function write ( client , request ) {
function write ( client , request ) {
const { body , method , path : path 2 , host , upgrade , headers , blocking } = request ;
const { body , method , path : path 3 , host , upgrade , headers , blocking } = request ;
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" ;
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" ;
if ( body && typeof body . read === "function" ) {
if ( body && typeof body . read === "function" ) {
body . read ( 0 ) ;
body . read ( 0 ) ;
@ -15549,7 +15549,7 @@ var require_client = __commonJS({
if ( blocking ) {
if ( blocking ) {
socket [ kBlocking ] = true ;
socket [ kBlocking ] = true ;
}
}
let header = ` ${ method } ${ path 2 } HTTP/1.1 \r
let header = ` ${ method } ${ path 3 } HTTP/1.1 \r
` ;
` ;
if ( typeof host === "string" ) {
if ( typeof host === "string" ) {
header += ` host: ${ host } \r
header += ` host: ${ host } \r
@ -17543,20 +17543,20 @@ var require_mock_utils = __commonJS({
}
}
return true ;
return true ;
}
}
function safeUrl ( path 2 ) {
function safeUrl ( path 3 ) {
if ( typeof path 2 !== "string" ) {
if ( typeof path 3 !== "string" ) {
return path 2 ;
return path 3 ;
}
}
const pathSegments = path 2 . split ( "?" ) ;
const pathSegments = path 3 . split ( "?" ) ;
if ( pathSegments . length !== 2 ) {
if ( pathSegments . length !== 2 ) {
return path 2 ;
return path 3 ;
}
}
const qp = new URLSearchParams ( pathSegments . pop ( ) ) ;
const qp = new URLSearchParams ( pathSegments . pop ( ) ) ;
qp . sort ( ) ;
qp . sort ( ) ;
return [ ... pathSegments , qp . toString ( ) ] . join ( "?" ) ;
return [ ... pathSegments , qp . toString ( ) ] . join ( "?" ) ;
}
}
function matchKey ( mockDispatch2 , { path : path 2 , method , body , headers } ) {
function matchKey ( mockDispatch2 , { path : path 3 , method , body , headers } ) {
const pathMatch = matchValue ( mockDispatch2 . path , path 2 ) ;
const pathMatch = matchValue ( mockDispatch2 . path , path 3 ) ;
const methodMatch = matchValue ( mockDispatch2 . method , method ) ;
const methodMatch = matchValue ( mockDispatch2 . method , method ) ;
const bodyMatch = typeof mockDispatch2 . body !== "undefined" ? matchValue ( mockDispatch2 . body , body ) : true ;
const bodyMatch = typeof mockDispatch2 . body !== "undefined" ? matchValue ( mockDispatch2 . body , body ) : true ;
const headersMatch = matchHeaders ( mockDispatch2 , headers ) ;
const headersMatch = matchHeaders ( mockDispatch2 , headers ) ;
@ -17574,7 +17574,7 @@ var require_mock_utils = __commonJS({
function getMockDispatch ( mockDispatches , key ) {
function getMockDispatch ( mockDispatches , key ) {
const basePath = key . query ? buildURL ( key . path , key . query ) : key . path ;
const basePath = key . query ? buildURL ( key . path , key . query ) : key . path ;
const resolvedPath = typeof basePath === "string" ? safeUrl ( basePath ) : basePath ;
const resolvedPath = typeof basePath === "string" ? safeUrl ( basePath ) : basePath ;
let matchedMockDispatches = mockDispatches . filter ( ( { consumed } ) => ! consumed ) . filter ( ( { path : path 2 } ) => matchValue ( safeUrl ( path2 ) , resolvedPath ) ) ;
let matchedMockDispatches = mockDispatches . filter ( ( { consumed } ) => ! consumed ) . filter ( ( { path : path 3 } ) => matchValue ( safeUrl ( path3 ) , resolvedPath ) ) ;
if ( matchedMockDispatches . length === 0 ) {
if ( matchedMockDispatches . length === 0 ) {
throw new MockNotMatchedError ( ` Mock dispatch not matched for path ' ${ resolvedPath } ' ` ) ;
throw new MockNotMatchedError ( ` Mock dispatch not matched for path ' ${ resolvedPath } ' ` ) ;
}
}
@ -17611,9 +17611,9 @@ var require_mock_utils = __commonJS({
}
}
}
}
function buildKey ( opts ) {
function buildKey ( opts ) {
const { path : path 2 , method , body , headers , query } = opts ;
const { path : path 3 , method , body , headers , query } = opts ;
return {
return {
path : path 2 ,
path : path 3 ,
method ,
method ,
body ,
body ,
headers ,
headers ,
@ -18025,10 +18025,10 @@ var require_pending_interceptors_formatter = __commonJS({
}
}
format ( pendingInterceptors ) {
format ( pendingInterceptors ) {
const withPrettyHeaders = pendingInterceptors . map (
const withPrettyHeaders = pendingInterceptors . map (
( { method , path : path 2 , data : { statusCode } , persist , times , timesInvoked , origin } ) => ( {
( { method , path : path 3 , data : { statusCode } , persist , times , timesInvoked , origin } ) => ( {
Method : method ,
Method : method ,
Origin : origin ,
Origin : origin ,
Path : path 2 ,
Path : path 3 ,
"Status code" : statusCode ,
"Status code" : statusCode ,
Persistent : persist ? "\u2705" : "\u274C" ,
Persistent : persist ? "\u2705" : "\u274C" ,
Invocations : timesInvoked ,
Invocations : timesInvoked ,
@ -20354,11 +20354,11 @@ var require_fetch = __commonJS({
const { request } = fetchParams ;
const { request } = fetchParams ;
const {
const {
protocol : scheme ,
protocol : scheme ,
pathname : path 2
pathname : path 3
} = requestCurrentURL ( request ) ;
} = requestCurrentURL ( request ) ;
switch ( scheme ) {
switch ( scheme ) {
case "about:" : {
case "about:" : {
if ( path 2 === "blank" ) {
if ( path 3 === "blank" ) {
const resp = makeResponse ( {
const resp = makeResponse ( {
statusText : "OK" ,
statusText : "OK" ,
headersList : [
headersList : [
@ -20989,11 +20989,11 @@ var require_undici = __commonJS({
if ( typeof opts . path !== "string" ) {
if ( typeof opts . path !== "string" ) {
throw new InvalidArgumentError ( "invalid opts.path" ) ;
throw new InvalidArgumentError ( "invalid opts.path" ) ;
}
}
let path 2 = opts . path ;
let path 3 = opts . path ;
if ( ! opts . path . startsWith ( "/" ) ) {
if ( ! opts . path . startsWith ( "/" ) ) {
path 2 = ` / ${ path2 } ` ;
path 3 = ` / ${ path3 } ` ;
}
}
url = new URL ( util . parseOrigin ( url ) . origin + path 2 ) ;
url = new URL ( util . parseOrigin ( url ) . origin + path 3 ) ;
} else {
} else {
if ( ! opts ) {
if ( ! opts ) {
opts = typeof url === "object" ? url : { } ;
opts = typeof url === "object" ? url : { } ;
@ -22060,6 +22060,7 @@ var src_default = shellac;
// src/index.ts
// src/index.ts
var import _undici = _ _toESM ( require _undici ( ) ) ;
var import _undici = _ _toESM ( require _undici ( ) ) ;
var import _process = require ( "process" ) ;
var import _process = require ( "process" ) ;
var import _node _path = _ _toESM ( require ( "path" ) ) ;
try {
try {
const apiToken = ( 0 , import _core . getInput ) ( "apiToken" , { required : true } ) ;
const apiToken = ( 0 , import _core . getInput ) ( "apiToken" , { required : true } ) ;
const accountId = ( 0 , import _core . getInput ) ( "accountId" , { required : true } ) ;
const accountId = ( 0 , import _core . getInput ) ( "accountId" , { required : true } ) ;
@ -22067,6 +22068,7 @@ try {
const directory = ( 0 , import _core . getInput ) ( "directory" , { required : true } ) ;
const directory = ( 0 , import _core . getInput ) ( "directory" , { required : true } ) ;
const gitHubToken = ( 0 , import _core . getInput ) ( "gitHubToken" , { required : false } ) ;
const gitHubToken = ( 0 , import _core . getInput ) ( "gitHubToken" , { required : false } ) ;
const branch = ( 0 , import _core . getInput ) ( "branch" , { required : false } ) ;
const branch = ( 0 , import _core . getInput ) ( "branch" , { required : false } ) ;
const workingDirectory = ( 0 , import _core . getInput ) ( "workingDirectory" , { required : false } ) ;
const getProject = async ( ) => {
const getProject = async ( ) => {
const response = await ( 0 , import _undici . fetch ) (
const response = await ( 0 , import _undici . fetch ) (
` https://api.cloudflare.com/client/v4/accounts/ ${ accountId } /pages/projects/ ${ projectName } ` ,
` https://api.cloudflare.com/client/v4/accounts/ ${ accountId } /pages/projects/ ${ projectName } ` ,
@ -22076,7 +22078,7 @@ try {
return result ;
return result ;
} ;
} ;
const createPagesDeployment = async ( ) => {
const createPagesDeployment = async ( ) => {
await src _default `
await src _default . in ( import _node _path . default . join ( process . cwd ( ) , workingDirectory ) ) `
$ export CLOUDFLARE _API _TOKEN = "${apiToken}"
$ export CLOUDFLARE _API _TOKEN = "${apiToken}"
if $ { accountId } {
if $ { accountId } {
$ export CLOUDFLARE _ACCOUNT _ID = "${accountId}"
$ export CLOUDFLARE _ACCOUNT _ID = "${accountId}"