Skip to content

Commit

Permalink
Calculate the merge-base against the appropriate branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Feb 26, 2024
1 parent c50635c commit 38a4282
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/jobs/BenchmarkJob.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ function BenchmarkJob(submission::JobSubmission)
against = againstbuild
elseif submission.prnumber !== nothing
# if there is a PR number, we compare against the base branch
pr_details = GitHub.pull_request(submission.repo, submission.prnumber; auth=submission.config.auth)
base_branch = pr_details.base.ref
merge_base = GitHub.compare(submission.repo,
"master", "refs/pull/$(submission.prnumber)/head";
base_branch, "refs/pull/$(submission.prnumber)/head";
auth=submission.config.auth).merge_base_commit
against = commitref(submission.config, submission.repo, merge_base.sha)
else
Expand Down
4 changes: 3 additions & 1 deletion src/jobs/PkgEvalJob.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ function PkgEvalJob(submission::JobSubmission)
elseif submission.prnumber !== nothing
# if there is a PR number, we compare against the base branch.
# this does not apply to packages, where we compare against the latest release.
pr_details = GitHub.pull_request(submission.repo, submission.prnumber; auth=submission.config.auth)
base_branch = pr_details.base.ref
merge_base = GitHub.compare(submission.repo,
"master", "refs/pull/$(submission.prnumber)/head";
base_branch, "refs/pull/$(submission.prnumber)/head";
auth=submission.config.auth).merge_base_commit
against = commitref(submission.config, submission.repo, merge_base.sha)
else
Expand Down

0 comments on commit 38a4282

Please sign in to comment.