Skip to content

Commit

Permalink
fix: reconcile configuration input (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
phidol authored Nov 4, 2024
1 parent 23a4fff commit a22bc8b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions vercel-deployment-task-source/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,23 @@ function reconcileConfigurationInput(
);
}

if (!envVarValue) {
if (!inputValue) {
if (!defaultValue) {
throw new Error(
`${name} must be specified using input \`${inputKey}\` or environment variable \`${envVarKey}\``
);
}

setVariable(envVarKey, defaultValue);
return defaultValue;
}

if (inputValue) {
setVariable(envVarKey, inputValue);
return inputValue;
}

return envVarValue;
if (envVarValue) {
return envVarValue;
}

if (defaultValue) {
setVariable(envVarKey, defaultValue);
return defaultValue;
}

throw new Error(
`${name} must be specified using input \`${inputKey}\` or environment variable \`${envVarKey}\``
);
}

async function run() {
Expand Down
2 changes: 1 addition & 1 deletion vercel-deployment-task-source/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"version": {
"Major": 1,
"Minor": 6,
"Patch": 3
"Patch": 4
},
"instanceNameFormat": "Deploying $(vercelProject) to Vercel",
"inputs": [
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.3",
"version": "1.6.4",
"publisher": "Vercel",
"public": true,
"targets": [
Expand Down

0 comments on commit a22bc8b

Please sign in to comment.