-
Notifications
You must be signed in to change notification settings - Fork 140
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
Head vs base ahead error #7
Comments
Hi @rhaynes, thanks for opening this issue.
This is true for the base commit's branch ref, but not for the base commit's SHA. The action should be using the base commit's SHA which doesn't change even if the base branch ref gets updated after the PR is already open. Here's where it gets the base commit's SHA: Lines 29 to 36 in b17fbb0
I may be wrong though. I'll try to find some time over the next couple weeks to reproduce/verify this. |
Hi @sean-krail thanks for following up! I think I've figured out what's going on. You're correct the base sha doesn't change once the PR is open. The problem seems to be that the base sha is assigned when the PR is opened and is whatever sha is currently at for the base branch (as opposed to the commit sha when the branch was created off the base branch). In other words:
If you rebase on master for the 2nd PR, it's not an issue, but if the merge process for your repo is to merge branches into master without rebasing it throws the error above in the case described. In any case, the script correctly determines the diff between the base branch and head commit even though the head is behind the base commit so it seems like this error is unnecessary and the script would work as expected without it. |
as of jitterbit/get-changed-files#7 and others this is considered a bug by 'get-changed-files' author. On error there are still the correct list of files. In worst case we won't get any files and it isn't 'the end of the world' for us clearly.
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
…ted-git-info-2.8.9 chore(deps): bump hosted-git-info from 2.8.8 to 2.8.9
https://github.com/jitterbit/get-changed-files/blob/master/src/main.ts#L79
The base branch that github reports can be anywhere between the initial commit on the base branch where head branched off to the latest commit on the base branch (or any commit in between). This seems to happen most frequently when new commits are pushed after a PR is already open. This is fine for repos that require a rebase or merge on the base branch before merging a PR, but otherwise the line above occasionally throws an error. If this line were changed to
core.info
instead ofcore.setFailed
all changed files are reported correctly so it's probably unnecessary to consider this failed when that check doesn't pass.The text was updated successfully, but these errors were encountered: