-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependencies and references (#23)
- Loading branch information
1 parent
48e9708
commit c747ab6
Showing
8 changed files
with
3,273 additions
and
1,582 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
'use strict'; | ||
const Hoek = require('hoek'); | ||
const Hoek = require('@hapi/hoek'); | ||
|
||
module.exports = async function(commitMessage, issueNumber) { | ||
const pullRequestNumber = new RegExp(/(\(#\d+\))/); | ||
const numberToReplace = Hoek.reach( | ||
commitMessage.match(pullRequestNumber), | ||
'0' | ||
); | ||
let message; | ||
let author; | ||
const pullRequest = await this.client.pullRequests.get(Hoek.merge(this.ownerRepo, {number: issueNumber})); | ||
message = commitMessage.replace(numberToReplace, `[${numberToReplace}](${pullRequest.data.url})`); | ||
author = `[${pullRequest.data.user.login}](${pullRequest.data.user.url})`; | ||
const message = commitMessage.replace(numberToReplace, `[${numberToReplace}](${pullRequest.data.url})`); | ||
const author = `[${pullRequest.data.user.login}](${pullRequest.data.user.url})`; | ||
|
||
return `${message} ${author}`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.