Skip to content

Commit

Permalink
🔨 Fix: possible name clash
Browse files Browse the repository at this point in the history
  • Loading branch information
mountainash authored Mar 11, 2024
1 parent aa6a534 commit 8f16b47
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
22 changes: 11 additions & 11 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32237,9 +32237,9 @@ const execCmd = async (command, args, cwd) => {
}
options.cwd = cwd

core.info(`â–» EXEC: "${ command } ${ args }"`)
const exitCode = await exec(command, args, options)

core.info(`â–» EXEC: "${ command } ${ args }"`)
if (exitCode === 0)
throw new Error(`${ stderr } - ${ stdout.trim() }`)
return stdout.trim()
Expand All @@ -32260,7 +32260,7 @@ const removeSchema = (url) => {
}

module.exports = {
exec: execCmd,
execCmd,
addSchema,
removeSchema
}
Expand All @@ -32271,7 +32271,7 @@ module.exports = {
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

const core = __nccwpck_require__(2186)
const { exec, removeSchema } = __nccwpck_require__(5946)
const { execCmd, removeSchema } = __nccwpck_require__(5946)

const {
VERCEL_TOKEN,
Expand All @@ -32291,7 +32291,7 @@ const {
} = __nccwpck_require__(7779)

const init = () => {
core.info('Setting environment variables for Vercel CLI')
core.info('Setting environment variables for Vercel â–² CLI')
core.exportVariable('VERCEL_ORG_ID', VERCEL_ORG_ID)
core.exportVariable('VERCEL_PROJECT_ID', VERCEL_PROJECT_ID)

Expand Down Expand Up @@ -32343,7 +32343,7 @@ const init = () => {
}

core.info('Starting deploy with Vercel â–² CLI')
const output = await exec('vercel', commandArguments, WORKING_DIRECTORY)
const output = await execCmd('vercel', commandArguments, WORKING_DIRECTORY)
const match = output.match(/(?<=https?:\/\/)(.*)/g)
const parsed = match ? match[0] : null

Expand All @@ -32361,7 +32361,7 @@ const init = () => {
commandArguments.push(`--scope=${ VERCEL_SCOPE }`)
}

return await exec('vercel', commandArguments, WORKING_DIRECTORY)
return await execCmd('vercel', commandArguments, WORKING_DIRECTORY)
}

const getDeployment = async () => {
Expand Down Expand Up @@ -32494,13 +32494,13 @@ const run = async () => {
}

try {
core.info('Creating deployment with Vercel CLI')
core.info('Creating deployment with Vercel â–² CLI')
const vercel = Vercel.init()

const commit = ATTACH_COMMIT_METADATA ? await github.getCommit() : undefined
const deploymentUrl = await vercel.deploy(commit)

core.info('Successfully deployed to Vercel!')
core.info('Successfully deployed to Vercel â–²')

const deploymentUrls = []
if (IS_PR && PR_PREVIEW_DOMAIN) {
Expand All @@ -32520,7 +32520,6 @@ const run = async () => {
const previewDomainSuffix = '.vercel.app'
let nextAlias = alias


if (alias.endsWith(previewDomainSuffix)) {
let prefix = alias.substring(0, alias.indexOf(previewDomainSuffix))

Expand All @@ -32542,7 +32541,7 @@ const run = async () => {
}

if (ALIAS_DOMAINS) {
core.info('Assigning custom domains to Vercel deployment')
core.info('Assigning alias domains to Vercel â–² deployment')

if (!Array.isArray(ALIAS_DOMAINS)) {
throw new Error('🛑 invalid type for ALIAS_DOMAINS')
Expand Down Expand Up @@ -32578,7 +32577,8 @@ const run = async () => {
core.info('Checking for existing comment on PR')
const deletedCommentId = await github.deleteExistingComment()

if (deletedCommentId) core.info(`Deleted existing comment #${ deletedCommentId }`)
if (deletedCommentId)
core.info(`Deleted existing comment #${ deletedCommentId }`)
}

if (CREATE_COMMENT) {
Expand Down
4 changes: 2 additions & 2 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ const execCmd = async (command, args, cwd) => {
}
options.cwd = cwd

core.info(`â–» EXEC: "${ command } ${ args }"`)
const exitCode = await exec(command, args, options)

core.info(`â–» EXEC: "${ command } ${ args }"`)
if (exitCode === 0)
throw new Error(`${ stderr } - ${ stdout.trim() }`)
return stdout.trim()
Expand All @@ -39,7 +39,7 @@ const removeSchema = (url) => {
}

module.exports = {
exec: execCmd,
execCmd,
addSchema,
removeSchema
}
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ const run = async () => {
}

try {
core.info('Creating deployment with Vercel CLI')
core.info('Creating deployment with Vercel â–² CLI')
const vercel = Vercel.init()

const commit = ATTACH_COMMIT_METADATA ? await github.getCommit() : undefined
const deploymentUrl = await vercel.deploy(commit)

core.info('Successfully deployed to Vercel!')
core.info('Successfully deployed to Vercel â–²')

const deploymentUrls = []
if (IS_PR && PR_PREVIEW_DOMAIN) {
Expand All @@ -86,7 +86,6 @@ const run = async () => {
const previewDomainSuffix = '.vercel.app'
let nextAlias = alias


if (alias.endsWith(previewDomainSuffix)) {
let prefix = alias.substring(0, alias.indexOf(previewDomainSuffix))

Expand All @@ -108,7 +107,7 @@ const run = async () => {
}

if (ALIAS_DOMAINS) {
core.info('Assigning custom domains to Vercel deployment')
core.info('Assigning alias domains to Vercel â–² deployment')

if (!Array.isArray(ALIAS_DOMAINS)) {
throw new Error('🛑 invalid type for ALIAS_DOMAINS')
Expand Down Expand Up @@ -144,7 +143,8 @@ const run = async () => {
core.info('Checking for existing comment on PR')
const deletedCommentId = await github.deleteExistingComment()

if (deletedCommentId) core.info(`Deleted existing comment #${ deletedCommentId }`)
if (deletedCommentId)
core.info(`Deleted existing comment #${ deletedCommentId }`)
}

if (CREATE_COMMENT) {
Expand Down
8 changes: 4 additions & 4 deletions src/vercel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const core = require('@actions/core')
const { exec, removeSchema } = require('./helpers')
const { execCmd, removeSchema } = require('./helpers')

const {
VERCEL_TOKEN,
Expand All @@ -19,7 +19,7 @@ const {
} = require('./config')

const init = () => {
core.info('Setting environment variables for Vercel CLI')
core.info('Setting environment variables for Vercel â–² CLI')
core.exportVariable('VERCEL_ORG_ID', VERCEL_ORG_ID)
core.exportVariable('VERCEL_PROJECT_ID', VERCEL_PROJECT_ID)

Expand Down Expand Up @@ -71,7 +71,7 @@ const init = () => {
}

core.info('Starting deploy with Vercel â–² CLI')
const output = await exec('vercel', commandArguments, WORKING_DIRECTORY)
const output = await execCmd('vercel', commandArguments, WORKING_DIRECTORY)
const match = output.match(/(?<=https?:\/\/)(.*)/g)
const parsed = match ? match[0] : null

Expand All @@ -89,7 +89,7 @@ const init = () => {
commandArguments.push(`--scope=${ VERCEL_SCOPE }`)
}

return await exec('vercel', commandArguments, WORKING_DIRECTORY)
return await execCmd('vercel', commandArguments, WORKING_DIRECTORY)
}

const getDeployment = async () => {
Expand Down

0 comments on commit 8f16b47

Please sign in to comment.