Skip to content

Checking out within a PR does not create new merge commit when restarting CI jobs #2142

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
danieldegrasse opened this issue Apr 11, 2025 · 0 comments

Comments

@danieldegrasse
Copy link

When using actions/checkout@v4 with a config like the following:

- name: Checkout the code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

The initial commit the repo is checked out at corresponds to pull/<pr-no>/merge at the time of the PR synchronization event, as expected. However, if the CI job is manually restarted after another PR is merged to the main branch, the SHA of the commit remains the same as it was prior to main being updated

For an example see: tenstorrent/tt-zephyr-platforms#119

This can be worked around by setting ref: ${{ github.ref }} in the action YAML, like so:

- name: Checkout the code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
          ref: ${{ github.ref }}

With this change, restarts of the CI run will always fetch the latest pull/<pr-no>/merge

The impact of this is that when CI is broken on mainline and a fix is merged, PR branches must be updated to trigger a synchronization event (unless the workaround described is used)

Is this expected behavior? IE is the commit used not suppose to update on manual restarts of CI jobs?

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

2 participants
@danieldegrasse and others