Skip to content

Commit

Permalink
feat: add output for original deployment url to enable creation of ow…
Browse files Browse the repository at this point in the history
…n alias in separate task (#30)
  • Loading branch information
phidol authored Aug 22, 2024
1 parent 9902318 commit 1497fbc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ The configuration inputs `vercelProjectID`, `vercelOrgID`, and `vercelToken` can

Type: `string`

- `originalDeploymentURL`

Original URL of the deployment. Can be used to create your own alias in a separate task.

Type: `string`

- `deploymentTaskMessage`

The output from the deployment. Can be passed to Vercel Azure DevOps Pull Request Comment Task.
Expand Down
4 changes: 3 additions & 1 deletion vercel-deployment-task-source/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ async function run() {
);
}

let deployURL = stdout;
const originalDeployURL = stdout;
let deployURL = originalDeployURL;

if (!deployToProduction) {
if (branchName) {
Expand Down Expand Up @@ -342,6 +343,7 @@ async function run() {
}
}

setVariable("originalDeploymentURL", originalDeployURL, false, true);
setVariable("deploymentURL", deployURL, false, true);
const message = `Successfully deployed to ${deployURL}`;
setVariable("deploymentTaskMessage", message, false, true);
Expand Down
6 changes: 5 additions & 1 deletion vercel-deployment-task-source/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@
"name": "deploymentURL",
"description": "The URL of the deployment."
},
{
"name": "originalDeploymentURL",
"description": "Original URL of the deployment. Can be used to create your own alias in a separate task."
},
{
"name": "deploymentTaskMessage",
"description": "The message output from the deployment. Can be passed to Vercel Azure DevOps Pull Request Comment Task."
Expand All @@ -80,4 +84,4 @@
"target": "dist/index.js"
}
}
}
}

0 comments on commit 1497fbc

Please sign in to comment.