Skip to content

Commit

Permalink
feat: add support for target option (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
phidol authored Jan 8, 2025
1 parent 5ca02e3 commit d23aa66
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ The configuration inputs `vercelProjectID`, `vercelOrgID`, and `vercelToken` can

Required: `false`

- `target`

Option to define the environment you want to deploy to. This could be production, preview, or a custom environment. For more information, see [Using an environment through the Vercel CLI](https://vercel.com/docs/deployments/custom-environments#using-an-environment-through-the-vercel-cli).

Type: `string`

Default: `false`

Required: `false`

- `debug`

Enable `--debug` output for the internal Vercel CLI operations.
Expand Down
5 changes: 5 additions & 0 deletions vercel-deployment-task-source/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ async function run() {
try {
setResourcePath(path.join(__dirname, "..", "task.json"));

const target = getInput("target");

const debug = getBoolInput("debug");

const archive = getBoolInput("archive");
Expand Down Expand Up @@ -195,6 +197,9 @@ async function run() {
if (vercelCurrentWorkingDirectory) {
vercelDeployArgs.push(`--cwd=${vercelCurrentWorkingDirectory}`);
}
if (target) {
vercelDeployArgs.push(`--target=${target}`);
}
if (debug) {
vercelDeployArgs.push("--debug");
}
Expand Down
11 changes: 9 additions & 2 deletions vercel-deployment-task-source/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"author": "Vercel",
"version": {
"Major": 1,
"Minor": 6,
"Patch": 5
"Minor": 7,
"Patch": 0
},
"instanceNameFormat": "Deploying $(vercelProject) to Vercel",
"inputs": [
Expand Down Expand Up @@ -50,6 +50,13 @@
"required": false,
"helpMarkDown": "Should the task deploy to production? Defaults to false"
},
{
"name": "target",
"type": "string",
"label": "Environment to deploy to",
"required": false,
"helpMarkDown": "Option to define the environment you want to deploy to. This could be production, preview, or a custom environment. For more information, see [Using an environment through the Vercel CLI](https://vercel.com/docs/deployments/custom-environments#using-an-environment-through-the-vercel-cli)."
},
{
"name": "debug",
"type": "boolean",
Expand Down
2 changes: 1 addition & 1 deletion vss-extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"manifestVersion": 1,
"id": "vercel-deployment-extension",
"name": "Vercel Deployment Extension",
"version": "1.6.5",
"version": "1.7.0",
"publisher": "Vercel",
"public": true,
"targets": [
Expand Down

0 comments on commit d23aa66

Please sign in to comment.