Skip to content

Commit 2168397

Browse files
committed
Mention issue number in commit
1 parent 08115d7 commit 2168397

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/github.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ async function createPR (app, ctx, config, username, branchName) {
211211
try {
212212
const commitSha = await getBranchHeadSha(ctx, branchName)
213213
const treeSha = await getCommitTreeSha(ctx, commitSha)
214-
const emptyCommitSha = await createCommit(ctx, commitSha, treeSha, username, `Create ${draftText}PR`)
214+
const emptyCommitSha = await createCommit(ctx, commitSha, treeSha, username,
215+
`Create ${draftText}PR for #${issueNumber}`)
215216
await updateReference(ctx, branchName, emptyCommitSha)
216217
await ctx.octokit.pulls.create(
217218
{ owner, repo, head: branchName, base, title, body: `closes #${issueNumber}`, draft: draft })

tests/github.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ test('create (draft) PR', async () => {
219219
body: 'closes #1',
220220
title: 'Hello world'
221221
})
222-
expect(capturedCommitMessage).toBe('Create PR')
222+
expect(capturedCommitMessage).toBe('Create PR for #1')
223223
await github.createPR({ log: () => { } }, ctx, { silent: false, openDraftPR: true },
224224
'robvanderleek', 'issue-1')
225225
expect(createPR).toHaveBeenCalledWith({
@@ -231,5 +231,5 @@ test('create (draft) PR', async () => {
231231
body: 'closes #1',
232232
title: 'Hello world'
233233
})
234-
expect(capturedCommitMessage).toBe('Create draft PR')
234+
expect(capturedCommitMessage).toBe('Create draft PR for #1')
235235
})

0 commit comments

Comments
 (0)