diff --git a/README.md b/README.md index 70ec620..c89e402 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ Name | Decription `base_sha` | The head sha of the branch the pull request will merge into. `head_ref` | The name of the pull request branch the comment belongs to. `head_sha` | The head sha of the pull request branch the comment belongs to. +`merge_ref` | The refspec to the merged pull request. ## License diff --git a/src/PullRequests.ts b/src/PullRequests.ts index 59c4b1d..be7f547 100644 --- a/src/PullRequests.ts +++ b/src/PullRequests.ts @@ -72,5 +72,6 @@ export async function pullRequestDetails(token: string) { base_sha: baseRef.target.oid, head_ref: headRef.name, head_sha: headRef.target.oid, + merge_ref: 'refs/pull/' + context.issue.number + '/merge', }; } diff --git a/src/main.ts b/src/main.ts index 14720a7..130399a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -15,12 +15,14 @@ export async function run() { base_sha, head_ref, head_sha, + merge_ref, } = await pullRequestDetails(token); setOutput("base_ref", base_ref); setOutput("base_sha", base_sha); setOutput("head_ref", head_ref); setOutput("head_sha", head_sha); + setOutput("merge_ref", merge_ref); } catch (error) { if (error instanceof Error) { setFailed(error.message);