Skip to content

Commit c707e6d

Browse files
committed
resolves #3 attach annotations to the pull request
1 parent ec14845 commit c707e6d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

dist/index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,13 @@ async function run () {
412412
const title = core.getInput('title', { required: false })
413413

414414
const octokit = new github.getOctokit(repoToken)
415-
const ref = github.context.sha
415+
const pullRequest = github.context.payload.pull_request
416+
let ref
417+
if (pullRequest) {
418+
ref = pullRequest.head.sha
419+
} else {
420+
ref = github.context.sha
421+
}
416422
const owner = github.context.repo.owner
417423
const repo = github.context.repo.repo
418424

index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,13 @@ async function run () {
139139
const title = core.getInput('title', { required: false })
140140

141141
const octokit = new github.getOctokit(repoToken)
142-
const ref = github.context.sha
142+
const pullRequest = github.context.payload.pull_request
143+
let ref
144+
if (pullRequest) {
145+
ref = pullRequest.head.sha
146+
} else {
147+
ref = github.context.sha
148+
}
143149
const owner = github.context.repo.owner
144150
const repo = github.context.repo.repo
145151

0 commit comments

Comments
 (0)