Skip to content

Add merge_ref option #483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/PullRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
}
2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down