Skip to content

Commit d23aa66

Browse files
authored
feat: add support for target option (#46)
1 parent 5ca02e3 commit d23aa66

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,16 @@ The configuration inputs `vercelProjectID`, `vercelOrgID`, and `vercelToken` can
154154

155155
Required: `false`
156156

157+
- `target`
158+
159+
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).
160+
161+
Type: `string`
162+
163+
Default: `false`
164+
165+
Required: `false`
166+
157167
- `debug`
158168

159169
Enable `--debug` output for the internal Vercel CLI operations.

vercel-deployment-task-source/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ async function run() {
128128
try {
129129
setResourcePath(path.join(__dirname, "..", "task.json"));
130130

131+
const target = getInput("target");
132+
131133
const debug = getBoolInput("debug");
132134

133135
const archive = getBoolInput("archive");
@@ -195,6 +197,9 @@ async function run() {
195197
if (vercelCurrentWorkingDirectory) {
196198
vercelDeployArgs.push(`--cwd=${vercelCurrentWorkingDirectory}`);
197199
}
200+
if (target) {
201+
vercelDeployArgs.push(`--target=${target}`);
202+
}
198203
if (debug) {
199204
vercelDeployArgs.push("--debug");
200205
}

vercel-deployment-task-source/task.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"author": "Vercel",
1111
"version": {
1212
"Major": 1,
13-
"Minor": 6,
14-
"Patch": 5
13+
"Minor": 7,
14+
"Patch": 0
1515
},
1616
"instanceNameFormat": "Deploying $(vercelProject) to Vercel",
1717
"inputs": [
@@ -50,6 +50,13 @@
5050
"required": false,
5151
"helpMarkDown": "Should the task deploy to production? Defaults to false"
5252
},
53+
{
54+
"name": "target",
55+
"type": "string",
56+
"label": "Environment to deploy to",
57+
"required": false,
58+
"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)."
59+
},
5360
{
5461
"name": "debug",
5562
"type": "boolean",

vss-extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"manifestVersion": 1,
44
"id": "vercel-deployment-extension",
55
"name": "Vercel Deployment Extension",
6-
"version": "1.6.5",
6+
"version": "1.7.0",
77
"publisher": "Vercel",
88
"public": true,
99
"targets": [

0 commit comments

Comments
 (0)