Skip to content

Conversation

@robertkirkman
Copy link
Member

# not HEAD~$(git rev-list --count FETCH_HEAD..)
# See https://github.com/actions/checkout/issues/504 for more information
if [[ "${CI-false}" == "true" ]]; then
base_commit="HEAD~"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TomJo2000 after thinking about the problem for a while, I came up with this potential idea, if you check the log this generated and look at the base_commit: log message I printed below this, it looks like this is correct, what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're applying the wrong formula and getting the right result, and I don't know how to explain that.

You mentioned that you could go into more detail about how it's breaking, and I think I don't have a full picture of what is causing it to break.

If this workaround is consistent I'm fine with it, though I'd prefer you write it as either HEAD^ or HEAD~1, unless those are actually different, which I don't see how they could be.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're applying the wrong formula and getting the right result, and I don't know how to explain that.

I agree that this is confusing, and I don't know exactly how to explain fully why my idea works to prevent the error, but you can see that the printed base_commit: log message in this PR's CI run appears to be correct, right?

I basically reached this current patch by inspecting what various git commands showed in CI versus locally, and how they are different, and noticed that this change appears to produce the correct result in CI,

while the code that produces the correct result locally outside of CI (the current lint-packages.sh in master branch) doesn't work reliably in CI - this edge case I keep reproducing causes the current lint-packages.sh in master branch to fail every time I set up a certain crafted input (these manipulated test draft PRs I keep opening)

You mentioned that you could go into more detail about how it's breaking, and I think I don't have a full picture of what is causing it to break.

I agree it would be best to continue discussing this until the picture of what is happening is clearer, I can try adding log messages of any other commands you can think of that might show additional information, do you have ideas for what other logs you would want to see to inspect this?

I could try to explain in more detail exactly how I set up the crafted input test draft PRs so you can make one too and step through the process of what is happening, would you like me to try that?

If this workaround is consistent I'm fine with it, though I'd prefer you write it as either HEAD^ or HEAD~1,

sure, I'll test that as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HEAD~1 instead of HEAD~ is also working.

@robertkirkman robertkirkman force-pushed the force-break-lint-packages-test5 branch from b9b6ef4 to 907241e Compare November 11, 2025 11:11
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

Successfully merging this pull request may close these issues.

2 participants