fix(aio): create a proper commit link on preview comments (#15941)
Previously, only a few characters of the SHA would appear on the preview link comment posted on the PR. This was usually enough for GitHub to create a link to the corresponding commit, but it was possible to have collisions with other commits with the same first characters (which prevented GitHub from identifying the correct commit and create a link.) This commit fixes this issue by including the full SHA on the commentso GitHub can identify the correct commit and create the link. GitHub will automatically truncate the link text (by default to 7 chars unless more are necessary to uniquely identify the commit).
This commit is contained in:

committed by
Tobias Bosch

parent
9394835db4
commit
14b7dfa007
@ -58,7 +58,7 @@ class UploadServerFactory {
|
||||
const githubPullRequests = new GithubPullRequests(githubToken, repoSlug);
|
||||
|
||||
buildCreator.on(CreatedBuildEvent.type, ({pr, sha}: CreatedBuildEvent) => {
|
||||
const body = `The angular.io preview for ${sha.slice(0, 7)} is available [here][1].\n\n` +
|
||||
const body = `The angular.io preview for ${sha} is available [here][1].\n\n` +
|
||||
`[1]: https://pr${pr}-${sha}.${domainName}/`;
|
||||
|
||||
githubPullRequests.addComment(pr, body);
|
||||
|
Reference in New Issue
Block a user