todo-to-issue-action icon indicating copy to clipboard operation
todo-to-issue-action copied to clipboard

Action can't retrieve diff when commit is amended

Open DetachHead opened this issue 3 years ago • 8 comments

Screenshot_20210913-004038

DetachHead avatar Sep 12 '21 14:09 DetachHead

Hmm… Looks like the action isn’t building the correct URL, so it’s returning a bad response. I’ll try and test/fix this tomorrow. Thanks for the heads up.

alstr avatar Sep 12 '21 17:09 alstr

I've just tried to run the action on an initial commit and it seemed to work fine for me. Please could you share with me your workflow file, or the section earlier in the log (blanking out any sensitive info)?

alstr avatar Sep 13 '21 15:09 alstr

yeah my bad, was on my phone when i raised it. here's one from a different repo that's public https://github.com/DetachHead/typescript-nodejs-project/runs/3113490991?check_suite_focus=true

DetachHead avatar Sep 13 '21 15:09 DetachHead

I just had a look at your public repos and saw that. I think the problem here is that you are using a very old version where there was no support for initial commits. Please try alstr/[email protected] and hopefully you should be fine.

alstr avatar Sep 13 '21 15:09 alstr

hmm, i can't seem to reproduce it anymore but i think it may have something to do with me amending the initial commit. i just made the repo where it happened public so you can take a look if you want https://github.com/DetachHead/ublock-discord/runs/3579846605?check_suite_focus=true

DetachHead avatar Sep 13 '21 16:09 DetachHead

Ah. Looking at the logs, it's saying the before SHA is 33d603fa237dd605a7c5b7b02a833b648a02c184, but it looks like that commit no longer exists as you've amended it. I think that is where the problem lies as you said.

The action will be querying this URL and getting a bad response:

https://api.github.com/repos/DetachHead/ublock-discord/compare/33d603fa237dd605a7c5b7b02a833b648a02c184...a8276d1ea1c3ef59938b59d689a923158ed709e6

In that case it should probably be querying:

https://api.github.com/repos/DetachHead/ublock-discord/commits/a8276d1ea1c3ef59938b59d689a923158ed709e6

I will have a think about how best to handle this, as I imagine this problem could occur with any amended commit, not just the first. It will add some complexity to the structure me and @lgvalle implemented recently.

alstr avatar Sep 13 '21 16:09 alstr

Hi @alstr – is there any plan for a fix for this?

adamklingbaum avatar Jan 21 '23 23:01 adamklingbaum

Hey, it's still on the list to look at but I don't have an ETA I'm afraid. One workaround that might help is you can now run the action manually, so after amending the commit you could run it again with the updated commit refs.

alstr avatar Jan 30 '23 18:01 alstr