Hi all - Does anyone know how to get the pants `--...
# general
m
Hi all - Does anyone know how to get the pants
--changed-since
flag to work with a Github Action triggered by a Pull Request? I keep encountering issues such as "fatal origin/stage...HEAD: no merge base" , but don't know how to correct the issue. Can anyone help me? 🙏🤞
1
Here is the corresponding error message in the GitHub action run:
e
You've missed reading up on fetch depth and its default here I think: https://github.com/actions/checkout
m
Thanks John, that did the trick 🚀 I had previously tried two checkout steps (one for the PR commit and one for the
github.base_ref
to shy away from a potentially very time-consuming and expensive checkout step) but that didn't solve it so thought it might be something else. You once again saved me from hours of nightmarish debugging!
For posterity (if someone else comes across this thread), the solution was to change the checkout action to:
Copy code
- uses: actions/checkout@v3
  with:
    fetch-depth: 0  # NOTE: needed for pants --changed-since flag
@enough-analyst-54434 - I managed to get past the `Check BUILD files`step, but I now have a different issue on the next step with the error: "You used
--changed-since
at the same time as using glob arguments..."
Does this mean that I can't use
::
as the
./pants test
target?
e
Correct. Picture the mutex as so:
--changed-since
calculates the relevant changed file set and passes all those files in place of the
::
glob.
You can see this - sort of - with
./pants --changed-since... list
. That list of targets is what Pants acts on internally.
And debugging is your friend. The more you do it, the less you'll have to do it. It'll teach you things that help you avoid it in the future. Me feeding you an answer may have been short term helpful but it was long term harmful. Dig long and prosper!
🖖 3