Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle version input from artifact #9969

Merged
merged 2 commits into from
Mar 29, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"loc.input.help.connection": "GitHub service connection",
"loc.input.label.userRepository": "Repository",
"loc.input.help.userRepository": "GitHub repository full name",
"loc.input.label.defaultVersionType": "Default release version type",
"loc.input.label.defaultVersionType": "Default version",
"loc.input.help.defaultVersionType": "Download assets from latest release or specific release version/tag",
"loc.input.label.version": "Release",
"loc.input.help.version": "Release version/tag to download",
Expand Down
21 changes: 9 additions & 12 deletions Tasks/DownloadGitHubReleaseV0/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,20 +159,17 @@ async function main(): Promise<void> {
}
}

if (!!defaultVersionType) {
switch (defaultVersionType.toLowerCase()) {
case 'latest': release = await executeWithRetries("getLatestRelease", () => getLatestRelease(repositoryName, customCredentialHandler), retryLimit).catch((reason) => { reject(reason); });
break;
case 'specifictag': release = await executeWithRetries("getTaggedRelease", () => getTaggedRelease(repositoryName, version, customCredentialHandler), retryLimit).catch((reason) => { reject(reason); });
break;
case 'specificversion': release = await executeWithRetries("getSpecificRelease", () => getSpecificRelease(repositoryName, version, customCredentialHandler), retryLimit).catch((reason) => { reject(reason); });
break;
default: release = null;
}
} else {
if (!!defaultVersionType && defaultVersionType.toLowerCase() == 'specificversion') {
release = await executeWithRetries("getSpecificRelease", () => getSpecificRelease(repositoryName, version, customCredentialHandler), retryLimit).catch((reason) => { reject(reason); });
}
else if (!!defaultVersionType && defaultVersionType.toLowerCase() == 'specifictag') {
release = await executeWithRetries("getTaggedRelease", () => getTaggedRelease(repositoryName, version, customCredentialHandler), retryLimit).catch((reason) => { reject(reason); });
}
else if (!defaultVersionType || defaultVersionType.toLowerCase() == 'latest') {
if (!!version) {
release = await executeWithRetries("getTaggedRelease", () => getTaggedRelease(repositoryName, version, customCredentialHandler), retryLimit).catch((reason) => { reject(reason); });
gykuma marked this conversation as resolved.
Show resolved Hide resolved
} else {
}
else {
release = await executeWithRetries("getLatestRelease", () => getLatestRelease(repositoryName, customCredentialHandler), retryLimit).catch((reason) => { reject(reason); });
}
}
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DownloadGitHubReleaseV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"version": {
"Major": 0,
"Minor": 149,
"Patch": 0
"Patch": 1
},
"minimumAgentVersion": "1.99.0",
"instanceNameFormat": "Download GitHub Release",
Expand Down Expand Up @@ -40,7 +40,7 @@
{
"name": "defaultVersionType",
"type": "pickList",
"label": "Default release version type",
"label": "Default version",
"defaultValue": "latest",
"required": true,
"options": {
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DownloadGitHubReleaseV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"version": {
"Major": 0,
"Minor": 149,
"Patch": 0
"Patch": 1
},
"minimumAgentVersion": "1.99.0",
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
Expand Down