Skip to content
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

Action can't retrieve diff when commit is amended #77

Open
DetachHead opened this issue Sep 12, 2021 · 8 comments
Open

Action can't retrieve diff when commit is amended #77

DetachHead opened this issue Sep 12, 2021 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@DetachHead
Copy link

Screenshot_20210913-004038

@alstr
Copy link
Owner

alstr commented Sep 12, 2021

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
Copy link
Owner

alstr commented Sep 13, 2021

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)?

@DetachHead
Copy link
Author

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

@alstr
Copy link
Owner

alstr commented Sep 13, 2021

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/todo-to-issue-action@v4.2 and hopefully you should be fine.

@DetachHead
Copy link
Author

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

@alstr
Copy link
Owner

alstr commented Sep 13, 2021

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 alstr changed the title crashes on initial commits Action can't retrieve diff when commit is amended Sep 13, 2021
@alstr alstr self-assigned this Sep 13, 2021
@alstr alstr added the bug Something isn't working label Sep 13, 2021
@adamklingbaum
Copy link

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

@alstr
Copy link
Owner

alstr commented Jan 30, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants