Skip to content

Commit

Permalink
fix: add vercel-project-name option that allows us to skip vercel ins…
Browse files Browse the repository at this point in the history
…pect bug
  • Loading branch information
EvanLovely committed Aug 10, 2020
1 parent 98fe494 commit 846a629
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ inputs:
vercel-org-id:
required: false
description: 'Vercel CLI 17+, ❗️ The `name` property in vercel.json is deprecated (https://zeit.ink/5F)'
vercel-project-name:
required: false
description: "The name of the project; if absent we'll use the `vercel inspect` command to determine."
scope:
required: false
description: 'If you are work in team scope, you should set this value to your team id.'
Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const vercelArgs = core.getInput('vercel-args');
const vercelOrgId = core.getInput('vercel-org-id');
const vercelProjectId = core.getInput('vercel-project-id');
const vercelScope = core.getInput('scope');
const vercelProjectName = core.getInput('vercel-project-name');
const aliasDomains = core
.getInput('alias-domains')
.split('\n')
Expand Down Expand Up @@ -324,7 +325,10 @@ async function run() {
core.warning('get preview-url error');
}

const deploymentName = await vercelInspect(deploymentUrl);
let deploymentName = vercelProjectName;
if (!deploymentName) {
deploymentName = await vercelInspect(deploymentUrl);
}
if (deploymentName) {
core.info('set preview-name output');
core.setOutput('preview-name', deploymentName);
Expand Down

0 comments on commit 846a629

Please sign in to comment.