actions / actions/checkout

Checkout for PR is not simulating a merge with HEAD of `main`

Open
#696 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
8.9k
Forks
2.8k
PR merge metrics
No merged PRs in 30d

Description

I am running into some issues, because checkout action is doing a merge of PR into wrong SHA.

When running checkout on this repository:
https://github.com/raycast/extensions

You can see unwanted behaviour here:
https://github.com/raycast/extensions/runs/5185777181?check_suite_focus=true#step:2:486

It merged the HEAD of PULLREQUEST with some random commit from main - cd113f35.
It looks like this visually:

Red arrow is how the merge is done now, green is how I would expect it to work.

CleanShot 2022-02-14 at 18 26 51@2x

What I think should be happening here is that PR should be done between 4706f01c76ef11c4220e9f81e99e13cc58e80642 and de0735da937fb75489043e4ed89e5d96a6b4dbeb.

This is maybe because this PR is coming from a forked repository.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the checkout action behavior and the linked workflow run, focusing on how forked pull request refs and main SHAs are selected. Reproduce the reported merge using the referenced repository and compare the current merge with the expected merge between 4706f01c76ef11c4220e9f81e99e13cc58e80642 and de0735da937fb75489043e4ed89e5d96a6b4dbeb.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, github-actions, typescript
Domain
ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.