Skip to content

Merge commit ref shouldn't stay same after changing base branch for a PR #919

Open
@mqasimsarfraz

Description

@mqasimsarfraz

We know that the workflows triggered via pull_request event uses merge commit as GITHUB_SHA. Now I would expect that if we change the base branch (using 'edit' button on the pull request in GitHub UI) there would be a new merge commit and that should be used if I trigger the workflow. But with my testing the action/checkout still uses old merge commit from previous base branch. If I push any further commits everything works as expected and action/checkout fetches the updated merge commit.

Steps to reproduce

Assuming you have workflow triggered on all pull_request events:

  1. Create 3 branches foo, bar, foobar
  2. Create a PR from foo in bar.
  3. Check the fetched ref in action workflow logs.
  4. Change the base branch from bar to foobar
  5. Trigger the action again.
  6. The fetched ref should be same as step 3.

Workaround

  • Push new commits to propagate the merge commit change.
  • Specify the job ref in step to make sure it has updated value for example

Comments

I know it might be the limitation of the system but wanted to open the issue so more people are aware of it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions