diff --git a/packages/sfp-cli/src/impl/changelog/ChangelogMarkdownGenerator.ts b/packages/sfp-cli/src/impl/changelog/ChangelogMarkdownGenerator.ts index 4c1b487e3..e5c795b25 100644 --- a/packages/sfp-cli/src/impl/changelog/ChangelogMarkdownGenerator.ts +++ b/packages/sfp-cli/src/impl/changelog/ChangelogMarkdownGenerator.ts @@ -96,10 +96,23 @@ export default class ChangelogMarkdownGenerator { let tableOfCommits = [['Date', 'Time', 'Commit ID', 'Commit Message']]; for (let commit of artifact.commits) { let commitDate: Date = new Date(commit.date); + let specificCommitURL: string; + if (artifact.repoUrl != null) { + if(artifact.repoUrl.startsWith("git")) + { + specificCommitURL=""; //no http url available + } + else if (artifact.repoUrl.includes("github.com")) { + let repoUrl = artifact.repoUrl.split('.git')[0]; + specificCommitURL = `${repoUrl}/commit/${commit.commitId}`; + } else { + specificCommitURL=""; //other git providers are not supported + } + } tableOfCommits.push([ this.getDate(commitDate), this.getTime(commitDate), - commit.commitId, + artifact.repoUrl?`[${commit.commitId}](${specificCommitURL})`:commit.commitId, commit.message, ]); } diff --git a/packages/sfp-cli/src/impl/changelog/ReleaseChangelog.ts b/packages/sfp-cli/src/impl/changelog/ReleaseChangelog.ts index 456d8544f..eb905fbbc 100644 --- a/packages/sfp-cli/src/impl/changelog/ReleaseChangelog.ts +++ b/packages/sfp-cli/src/impl/changelog/ReleaseChangelog.ts @@ -65,6 +65,11 @@ export interface Artifact extends Changelog { */ latestCommitId: string; + /** + * Repository URL where the artifact was generated + */ + repoUrl: string; + /** * Commits between previous artifact's package changelog and current artifact's package changelog */ diff --git a/packages/sfp-cli/src/impl/changelog/ReleaseChangelogUpdater.ts b/packages/sfp-cli/src/impl/changelog/ReleaseChangelogUpdater.ts index 4a8808c4b..2e2505f8b 100644 --- a/packages/sfp-cli/src/impl/changelog/ReleaseChangelogUpdater.ts +++ b/packages/sfp-cli/src/impl/changelog/ReleaseChangelogUpdater.ts @@ -168,6 +168,7 @@ export default class ReleaseChangelogUpdater { from: undefined, to: sfpPackage.sourceVersion?.slice(0, 8), version: sfpPackage.package_version_number, + repoUrl: sfpPackage.repository_url, latestCommitId: undefined, commits: undefined, };