Skip to content

Commit

Permalink
feat(releaselogs): add an option for workitem only output
Browse files Browse the repository at this point in the history
  • Loading branch information
azlam-abdulsalam committed Sep 4, 2023
1 parent 040d25c commit eeab3b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default class ChangelogImpl {
if(this.isDryRun)
{
const outputHandler:FileOutputHandler = FileOutputHandler.getInstance();
outputHandler.writeOutput('release-changelog.md',marked(new ChangelogMarkdownGenerator(releaseChangelog, this.workItemUrl, 1, false).generate()));
outputHandler.writeOutput('release-changelog.md',marked(new ChangelogMarkdownGenerator(releaseChangelog, this.workItemUrl, 1, false,true).generate()));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export default class ChangelogMarkdownGenerator {
private releaseChangelog: ReleaseChangelog,
private workItemURL: string,
private limit: number,
private showAllArtifacts: boolean
private showAllArtifacts: boolean,
private isForWorkItemOnlyOutput:boolean=false
) {}

/**
Expand All @@ -18,7 +19,7 @@ export default class ChangelogMarkdownGenerator {
generate(): string {
let payload: string = '';

if (this.releaseChangelog.orgs) {
if (this.releaseChangelog.orgs && ! this.isForWorkItemOnlyOutput ) {
payload = this.generateOrgs(this.releaseChangelog.orgs, payload);
}

Expand Down Expand Up @@ -49,10 +50,13 @@ export default class ChangelogMarkdownGenerator {

}

payload = this.generateArtifacts(payload, release);
if(!this.isForWorkItemOnlyOutput)
payload = this.generateArtifacts(payload, release);

payload = this.generateWorkItems(payload, release);

if(!this.isForWorkItemOnlyOutput)
{
let versionChangeOnly: string[] = [];
let noChangeInVersion: string[] = [];
payload = this.generateCommits(payload, release, versionChangeOnly, noChangeInVersion);
Expand All @@ -69,6 +73,7 @@ export default class ChangelogMarkdownGenerator {
payload += '\nArtifacts with no changes:\n';
noChangeInVersion.forEach((artifactName) => (payload += ` - ${artifactName}\n`));
}
}
}
return payload;
}
Expand Down

0 comments on commit eeab3b0

Please sign in to comment.