Skip to content

Commit a899e95

Browse files
committed
Fallback to git ref commit
1 parent 717143c commit a899e95

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/action.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,12 @@ async function pullRequestInfo(payload = {}) {
324324
commit = pullRequest.head.sha;
325325
} else if (payload.after) {
326326
commit = payload.after;
327+
} else if (payload.ref) {
328+
const { data } = await client.rest.git.getRef({
329+
ref: payload.ref.slice("refs/".length),
330+
...github.context.repo,
331+
});
332+
commit = data.object.sha;
327333
}
328334

329335
return { pullRequestNumber, commit };

0 commit comments

Comments
 (0)