Skip to content

Commit

Permalink
GitTools#1137 - use milestone for the action field for every GRM actions
Browse files Browse the repository at this point in the history
Made it consistent the fields used for the GRM actions
  • Loading branch information
arturcic committed Jul 9, 2024
1 parent f72dc8b commit 42a43f5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/tools/gitreleasemanager/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export enum OpenFields {
}

export enum PublishFields {
tagName = 'tagName'
milestone = 'milestone'
}

export enum AddAssetFields {
tagName = 'tagName',
milestone = 'milestone',
assets = 'assets'
}

Expand Down Expand Up @@ -66,10 +66,10 @@ export interface GitReleaseManagerOpenSettings extends GitReleaseManagerSettings
}

export interface GitReleaseManagerPublishSettings extends GitReleaseManagerSettings {
[PublishFields.tagName]: string
[PublishFields.milestone]: string
}

export interface GitReleaseManagerAddAssetSettings extends GitReleaseManagerSettings {
[AddAssetFields.tagName]: string
[AddAssetFields.milestone]: string
[AddAssetFields.assets]: string[]
}
8 changes: 4 additions & 4 deletions src/tools/gitreleasemanager/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,23 @@ export class GitReleaseManagerSettingsProvider extends SettingsProvider implemen
}

public getPublishSettings(): GitReleaseManagerPublishSettings {
const tagName = this.buildAgent.getInput(PublishFields.tagName)
const milestone = this.buildAgent.getInput(PublishFields.milestone)

const commonSettings = this.getCommonSettings()
return {
...commonSettings,
tagName
milestone
}
}

public getAddAssetSettings(): GitReleaseManagerAddAssetSettings {
const tagName = this.buildAgent.getInput(AddAssetFields.tagName)
const milestone = this.buildAgent.getInput(AddAssetFields.milestone)
const assets = this.buildAgent.getListInput(AddAssetFields.assets)

const commonSettings = this.getCommonSettings()
return {
...commonSettings,
tagName,
milestone,
assets
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/tools/gitreleasemanager/tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseMana
private getPublishArguments(settings: GitReleaseManagerPublishSettings): string[] {
const args: string[] = ['publish', ...this.getCommonArguments(settings)]

if (settings.tagName) {
args.push('--tagName', settings.tagName)
if (settings.milestone) {
args.push('--tagName', settings.milestone)
}

return args
Expand All @@ -194,8 +194,8 @@ export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseMana
private getAddAssetArguments(settings: GitReleaseManagerAddAssetSettings): string[] {
const args: string[] = ['addasset', ...this.getCommonArguments(settings)]

if (settings.tagName) {
args.push('--tagName', settings.tagName)
if (settings.milestone) {
args.push('--tagName', settings.milestone)
}
if (settings.assets && settings.assets.length > 0) {
settings.assets = settings.assets.map(asset => {
Expand Down

0 comments on commit 42a43f5

Please sign in to comment.