Closed nickderobertis closed 2 years ago
Thanks very much for this! I'll aim to take a look through it soon. Some changes to the diff processing were made in #72 to accommodate initial commits, so we'll just have to reconcile the two different features.
Happy to help, let me know if you want to discuss anything. I think these changes should be compatible already, but I did not thoroughly test it in commit triggers. It is working well for me in my fork so there's no rush on my end. Thanks!
Thanks, this is next on my list to test! 😄
First, thanks for the great action! Very useful.
I was trying to use this action in a workflow that was triggered by
pull_request
opened
, but it was failing because theINPUT_COMMITS
was coming in asNone
, and the main script checkslen(client.commits)
. At that point it was failing to find the length ofNoneType
.In the case of a PR event, we do not have the
commits
attribute, but we do haveevent.pull_request.diff_url
that directly gives the URL of a diff. Further,github.event.before
will not be set, butgithub.base_ref
will.I was able to get this working in a fork by adding a new
DIFF_URL
input and defaulting it togithub.event.pull_request.diff_url
, and having it check for thediff_url
before checking the length of commits.I also made
BEFORE
checkgithub.base_ref
if it does not findgithub.event.before
. This should not be strictly necessary asBEFORE
doesn't get used whenDIFF_URL
is used, so I'm happy to remove this change from the PR. But I have confirmed that this allowsBEFORE
to be set for either PR triggers or commit triggers.