Skip to content
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

Weird commit checked out during pull request trigger #1359

Open
pantelis-karamolegkos opened this issue May 27, 2023 · 4 comments
Open

Weird commit checked out during pull request trigger #1359

pantelis-karamolegkos opened this issue May 27, 2023 · 4 comments

Comments

@pantelis-karamolegkos
Copy link

pantelis-karamolegkos commented May 27, 2023

This is my trigger

on:
  pull_request:
    branches:
      - master

So I have an open PR targeting master from the branch my-feature

The tip of my branch is:

835e4b8 (HEAD ->my-feature origin/my-feature) Reset

I also noticed the following in the logs

 HEAD is now at c1d3b56 Merge 835e4b8 into a2f6789

where a2f6789 is the tip of the master.

Why is it using a distinct commit for the PR?

All the actions from that point on operate on this commit c1d3b56

@adamk9k
Copy link

adamk9k commented May 30, 2023

I'm seeing the same thing, it's essentially a merge commit from the parent branch.

I'm using

- uses: 'actions/checkout@v3'
   with:
     ref: ${{ github.event.pull_request.head.sha }}

for the time being to get around this bug.

Other parameters:

  • the action I saw this happen is using a self-hosted runner
  • potentially related to 47fbe2d

@pantelis-karamolegkos
Copy link
Author

Could it be that this has to do with the action operating on a (merge) commit that is being created (when the head branch is merged into the base branch)?

@adamk9k
Copy link

adamk9k commented May 30, 2023

In my case at least, we don't have merge commits on the repo, we rebase and the checkout itself seems to create a merge commit

@ramnes
Copy link

ramnes commented Jul 11, 2023

Seen this as well, and that's super confusing indeed. Looks like the action tries to merge with the target branch before continuing.

Seems related (or identical) to #237, #299, #626, #504, #881, #1325, and probably others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants