-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
v3 on: [pull_request]
doesn't actually check out branch, it rather checks out a version merged/based on top of the target branch, including changes from the target branch
#881
Comments
on: [pull_request]
doesn't actually check out branch, it rather checks out a version merged/based on top of the target branchon: [pull_request]
doesn't actually check out branch, it rather checks out a version merged/based on top of the target branch, including changes from the target branch
#112 added documentation on how to avoid the merge: https://github.com/actions/checkout/blob/v3.0.2/README.md#user-content-checkout-pull-request-head-commit-instead-of-merge-commit |
Thanks, so it's expected behavior. In that case, I'm asking to change it.
Meanwhile, I discovered that the CI would not run in this case. This is also a big drawback. Firstly it's unexpected and takes time to figure out why. But more importantly, I rely on the CI to run. E.g. I might run some checks (e.g. unit test) locally but would expect the CI to tell me if my changes integrate well with other parts of the software. Now I have to resolve conflicts every time as soon as they occur so that I can continue development? Awful. |
I'm curious, how did you start using the checkout action in your workflow; did you copy the workflow from a template? If so, perhaps the template could be improved by adding some comments to explain the behaviour. |
@KalleOlaviNiemitalo Found it in a project I started to work on :) There are many reasons to use
But that's beside the point I think. The point is that this is very surprising (as evidenced by the issues linked above) and therefore this probably isn't the right way to go about it. https://en.wikipedia.org/wiki/Principle_of_least_astonishment |
why am i getting these notification's I recently was hacked and found many accounts in my name. Does this have anything to do with that?
…-----Original Message-----
From: Csaba Apagyi ***@***.***>
To: actions/checkout ***@***.***>
Cc: Subscribed ***@***.***>
Sent: Wed, Aug 17, 2022 4:53 am
Subject: Re: [actions/checkout] v3 `on: [pull_request]` doesn't actually check out branch, it rather checks out a version merged/based on top of the target branch, including changes from the target branch (Issue #881)
Thanks, so it's expected behavior. In that case, I'm asking to change it.
What happens in case of conflict with the target branch?
Meanwhile, I discovered that the CI would not run in this case. This is also a big drawback. Firstly it's unexpected and takes time to figure out why. But more importantly, I rely on the CI to run. E.g. I might run some checks (e.g. unit test) locally but would expect the CI to tell me if my changes integrate well with other parts of the software. Now I have to resolve conflicts every time as soon as they occur so that I can continue development? Awful.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
I'm trying to get the list of files modified since The solution @KalleOlaviNiemitalo mentions above does not work. |
To clarify: I got here from dotnet/Nerdbank.GitVersioning#796 (comment) and am not using this action myself. |
Having similar issues on a private project, the checked-out code in the github action is not the code of the commit that has triggered the CI. Same use case (v3 |
I had similar issues but came up with this solution after some extensive digging. If checking out code using
|
Fix: github CI to use actual branch commit instead the merge on top of main. (actions/checkout#881) Fix: caching for docker and CI to make it more strict. We no longer pick local-build image on CI for integration tests Fix: migration tests that previously were skipped on CI Fix: postgres manager is handling multiple requests originated from the schema. Fix: satellite protocol code would previously crash on start/stop/start replication flow.
Fix: github CI to use actual branch commit instead the merge on top of main. (actions/checkout#881) Fix: caching for docker and CI to make it more strict. We no longer pick local-build image on CI for integration tests Fix: migration tests that previously were skipped on CI Fix: postgres manager is handling multiple requests originated from the schema. Fix: satellite protocol code would previously crash on start/stop/start replication flow.
Fix: github CI to use actual branch commit instead the merge on top of main. (actions/checkout#881) Fix: caching for docker and CI to make it more strict. We no longer pick local-build image on CI for integration tests Fix: migration tests that previously were skipped on CI Fix: postgres manager is handling multiple requests originated from the schema. Fix: satellite protocol code would previously crash on start/stop/start replication flow.
在启动auth, portal-web, mis-web, portal-server和mis-server时在日志中打印版本信息,包含`tag`和`commit`。npm会打印package.json的信息 ![image](https://user-images.githubusercontent.com/8363856/221754574-5b9b467a-aed4-438f-bdb1-7811636ae563.png) 注意:PR构建的容器的所log出来的commit号不是PR的commit的commit号!参考:actions/checkout#881 实现: 1. 在构建容器时,根据构建容器时的最新commit,生成一个`version.json`文件放在容器pwd下 2. 在这些组件启动时读取version.json和package.json的内容并生成内容
If there are technical issues fine, but in all other aspects (as issues tell), the expected behaviour for a user would be as the @thisismydesign described it, (the different users reporting issues about it this tells the same story). As an user I would expect it to checkout the latest code on a pr - i also had to do a workaround with refs explicitly. Anyway, thanks for the action!! |
Fix: github CI to use actual branch commit instead the merge on top of main. (actions/checkout#881) Fix: caching for docker and CI to make it more strict. We no longer pick local-build image on CI for integration tests Fix: migration tests that previously were skipped on CI Fix: postgres manager is handling multiple requests originated from the schema. Fix: satellite protocol code would previously crash on start/stop/start replication flow.
I think the issue is with github actions itself and not with the checkout action, since the checkout action uses by default the equivalent of {{github.sha}} which is the default branch for that trigger, and so for pull request trigger it does this merging before hand and results in this weird behavior. |
This is just to get the CI to re-trigger. Apparently the checkout action doesn't actually checkout the branch being proposed for merge but checks out an actual merge commit. So if you push a PR while main is broken it'll say changes from main are on your branch. That's a little unexpected. main is fixed now and I tried re-running the CI jobs from the web UI but they are still failing with the same errors. Hence this merge of main just to get a change on the branch. I could have gone and found a typo to fix instead. I know I've left enough of them around. ref: actions/checkout#881
Similar/same as
#237
#299
#626
#504
This issue isn't resolved on v3. It's very unexpected that instead of checking out the actual code I'm working on in the PR, the CI runs on a completely different code. I.e. code from the target branch will be included in the checked-out code. Can this even produce consistent behavior? What happens in case of conflict with the target branch?
GitHub has a feature to enforce keeping PRs up to date for those who wish to do so
I opened a new issue because the others were either closed as fixed, or the titles were not descriptive and there were no comments from maintainers. Can we explain whether this is even expected behavior?
The text was updated successfully, but these errors were encountered: