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

on pull request, checkout@v2 built some ref other than the one that was claimed #237

Closed
jepler opened this issue May 7, 2020 · 28 comments
Closed
Assignees

Comments

@jepler
Copy link

jepler commented May 7, 2020

Recently, I had a PR adafruit/circuitpython#2831 which checked out green, so a fellow developer merged it. It broke the build.

In subsequent investigation, I noticed that while the linked Actions run https://github.com/adafruit/circuitpython/runs/633447824?check_suite_focus=true shows that it was building the same ref as the one that was merged, down in the logs you find something different.

Under the step "Run actions/checkout@v2", "Checking out the ref",

HEAD is now at e7eef6f0c Merge 6dfe9ab606352b36f8d295b250ac7118c459618b into 2d7cf4b792afa1b6755b9575b84cae4b65ae7ab9

6dfe9ab represents another revision of the code that was apparently replaced by force-push with the later value 75be728:

@jepler force-pushed the jepler:rgbmatrix-stm branch from 6dfe9ab to e5be728 7 days ago

@ericsciple
Copy link
Contributor

ericsciple commented May 7, 2020

Thanks! I'll loop in some folks.

Indeed something looks wrong.

From the mpy-cross-mac check run, the step "Dump GitHub context" reveals some key info:

{
  [...]
  "ref": "refs/pull/2831/merge",
  "sha": "e7eef6f0ca41e82a3082df79b7abbd6a369433a6",
  "repository": "adafruit/circuitpython",
  "event_name": "pull_request",
  [...]
  "event": {
    "action": "synchronize",
    "after": "e5be728c1c8a3a455b7095c9dab9e758c5016191",
    "before": "6dfe9ab606352b36f8d295b250ac7118c459618b",
    "number": 2831,
    [...]

Yet appears to contradict the git log -1 output at the end of the step "Run actions/checkout@v2":

/usr/local/bin/git log -1
commit e7eef6f0ca41e82a3082df79b7abbd6a369433a6
Merge: 2d7cf4b79 6dfe9ab60
Author: Jeff Epler <[email protected]>
Date:   Wed Apr 29 19:23:50 2020 +0000

    Merge 6dfe9ab606352b36f8d295b250ac7118c459618b into 2d7cf4b792afa1b6755b9575b84cae4b65ae7ab9

It looks like ${{ github.sha }} is the old merge commit.

[edit]: The commit message should read: Merge e5be728c1c8a3a455b7095c9dab9e758c5016191 into 2d7cf4b792afa1b6755b9575b84cae4b65ae7ab9 (since e5be7 is the "after" sha)

@ericsciple
Copy link
Contributor

@andymckay have you heard of any similar occurrences?

The workflow payload contained the wrong merge commit.

@iheanyi iheanyi self-assigned this May 19, 2020
@iheanyi
Copy link

iheanyi commented May 19, 2020

👋🏾 Will be taking a look into this today and tomorrow.

@ericsciple
Copy link
Contributor

ericsciple commented May 19, 2020

Thanks @iheanyi for digging into this! We dug into this a bit and are unable to reproduce. This may be due to replication lag (received previous merge commit). Going forward we'll add more telemetry to the checkout step. So if this happens again we will be able to detect from telemetry.

@Bankst
Copy link

Bankst commented Jul 7, 2020

Hi, I just ran in to this same issue here:
PhotonVision/photonvision@f2305bb
The SHA for the commit is f2305bb501ec200d022a1bac4bac8ee316f68e54 but the workflow ran with commit 2e69b3e24b82faefc3702fc946834c61b31d8c4

https://github.com/PhotonVision/photonvision/pull/18/checks?check_run_id=844516246
Hopefully this can somehow help, having another known occurence

konkers added a commit to konkers/neutopia that referenced this issue Jul 8, 2020
v2 looks to have a bug where sometimes picking up the wrong commit.
actions/checkout#237
konkers added a commit to konkers/neutopia that referenced this issue Jul 8, 2020
v2 looks to have a bug where sometimes picking up the wrong commit.
actions/checkout#237
@kenorb
Copy link

kenorb commented Jul 13, 2020

Same happens when using with ad-m/github-push-action, related:

@kenorb
Copy link

kenorb commented Jul 13, 2020

My configuration is like:

  Push:
    if: github.event_name == 'pull_request'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          persist-credentials: false
          # Otherwise, you will failed to push refs to dest repo.
          fetch-depth: 0
          ref: refs/heads/${{ github.head_ref }} # Or: ${{ github.event.pull_request.head.ref }}
      - uses: actions/download-artifact@v2
         name: MyArtifact
      - name: Commit files
        run: |
          git config --local core.autocrlf false
          git config --local user.email $git_email
          git config --local user.name "${{ github.actor }}"
          git add . && git add --renormalize .
          git pull origin "${{ github.ref }}" --autostash --rebase -Xours
          git commit -am "${{ github.workflow }}"
        env:
          git_email: "${{ github.actor }}@users.noreply.github.com"
      - name: Push changes (not PR)
        if: github.event_name != 'pull_request'
        uses: ad-m/github-push-action@master
        with:
          branch: ${{ github.ref }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
      - name: Push changes (PR)
        if: github.event_name == 'pull_request'
        uses: ad-m/github-push-action@master
        with:
          branch: refs/heads/${{ github.head_ref }}
          github_token: ${{ secrets.GITHUB_TOKEN }}

Despite I'm checking out the right HEAD, I see some extra merge commits:

image

@kenorb
Copy link

kenorb commented Jul 13, 2020

Here are more details based on the build 866142019.

I'm pushing my changes using ad-m/github-push-action@master as per:

 Push changes (PR) >
    directory: .
Run ad-m/github-push-action@master
  with:
    branch: refs/heads/v1.079-dev
    github_token: ***
    directory: .
Started: bash /home/runner/work/_actions/ad-m/github-push-action/master/start.sh
Push to branch refs/heads/v1.079-dev
To https://github.com/EA31337/EA31337.git
   7173d15..7efcedf  HEAD -> v1.079-dev

So my HEAD changed from 7173d15 to 7efcedf (which is clearly visible above), however the checkout action (I assume) have added extra merge commit BETWEEN them, so my list of 3 last commits (instead of 2) looks like:

  1. "My triggering commit" SHA:7173d15
  2. "Merge 7173d15 into e24c723" SHA:8b7e516 (unwanted merge commit appearing out of blue)
  3. "Pushed action's commit" SHA:7efcedf

Where e24c723 is origin/master merge commit, whereas I've requested to checkout PR HEAD (ref: refs/heads/${{ github.head_ref }}).

@marian-vignau
Copy link

It happens to me, too.

It runs the action on the project's wrong commit

Go to
https://github.com/PyAr/CDPedia/runs/880106832

An you will see that the 5d8abdc commit number isn't in the log:

/usr/bin/git log -1
commit 5e52271eb4cfdbe501fb96f715efaf10b88d176c
Author: marian-vignau [email protected]
Date: Fri Jul 17 00:38:32 2020 +0000

Merge 2b611cc85e9500c0d94f1e01eaf0bcaf057d7119 into 7d813b430b1b41968577387df75c7ba98814ea65

And it happens again in https://github.com/PyAr/CDPedia/runs/871872757
The logs doesn't mention the commit number ed80113.
In the log

/usr/bin/git log -1
commit a4f842e8cd3b925513004b2adf64b626c3faa6cc
Author: marian-vignau [email protected]
Date: Wed Jul 15 00:56:28 2020 +0000

Merge 6ae6c1de90ef2bea523713ab8ac494a4354bbbe1 into f4899180fc5a4b2308cf5e1e092e3f58955db519

Thank you!

smowton added a commit to smowton/codeql-go that referenced this issue Aug 19, 2020
This reverts commit 8aaa7c8.

The bug it was working around (if it ever did) has been fixed.
smowton added a commit to github/codeql-go that referenced this issue Aug 20, 2020
pgils added a commit to pgils/docker-python-swiftclient that referenced this issue Dec 9, 2020
pgils added a commit to pgils/docker-python-swiftclient that referenced this issue Dec 9, 2020
@yurishkuro
Copy link

@andymckay it would be good to update this issue with the exact version number of checkout@v2 where the issue was fixed.

@Mubelotix
Copy link

Mubelotix commented Jan 27, 2022

Please let us know if you see this re-occuring.

@andymckay This is re-occuring. My whole CI is completely broken and corrupted. Help

Edit: I was wrong it was another issue

@andymckay
Copy link
Contributor

@Mubelotix I would recommend you contact customer support here: https://support.github.com/

Or you can open a new issue on this repository with as much information as you've got so the team can take a look.

arthurfiorette added a commit to arthurfiorette/axios-cache-interceptor that referenced this issue Feb 4, 2022
arthurfiorette added a commit to arthurfiorette/axios-cache-interceptor that referenced this issue Feb 8, 2022
* build: fixed `umd/es5` declaration file

* docs: updated download urls

* chore(deps-dev): bump @typescript-eslint/parser from 5.10.0 to 5.10.1 (#125)

Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.10.0 to 5.10.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.10.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump webpack-cli from 4.9.1 to 4.9.2 (#127)

Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.9.1 to 4.9.2.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/[email protected]@4.9.2)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump @typescript-eslint/eslint-plugin (#126)

* docs: gitter badge

* chore(deps-dev): bump es-check from 6.1.1 to 6.2.1 (#130)

* chore(deps-dev): bump eslint from 8.7.0 to 8.8.0 (#131)

* chore(deps-dev): bump @typescript-eslint/eslint-plugin (#134)

* chore(deps-dev): bump webpack from 5.67.0 to 5.68.0 (#133)

* chore(deps-dev): bump @typescript-eslint/parser from 5.10.1 to 5.10.2 (#132)

* build: es2017 as default output

* docs: updated benchmark

* chore: added .npmignore

* docs: updated benchmark

* docs: more examples

* style: formatted code

* docs: fixed benchmark

* ci: fixed actions/checkout#237

* chore: codecov bug was not fixed :(

* chore(deps-dev): bump jest from 27.4.7 to 27.5.0 (#136)

* chore(deps-dev): bump @typescript-eslint/eslint-plugin (#138)

* deps: updated dependencies

* tag: v0.8.6

* no: way that I did that

* tag: v0.8.7

* fix: now npmignore is happy

* tag: v0.8.8

* docs: updated download urls

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ansrivas added a commit to openobserve/openobserve that referenced this issue Jan 18, 2024
ansrivas added a commit to openobserve/openobserve that referenced this issue Jan 18, 2024
ansrivas added a commit to openobserve/openobserve that referenced this issue Jan 18, 2024
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