app-stats-action
app-stats-action copied to clipboard
Error handling improvement
The action failed here.
It looks like a user have removed the installation between the time installations are fetched and repos are fetched for that installation.
Can be fixed by wrapping a try catch around:
https://github.com/gr2m/app-stats-action/blob/49681496387bc37309e369f04ad30b4f27a13f35/lib/app-stats.js#L49-L71
Thanks Wei! Could you check if the installation (id: 5701088) has indeed been removed? Did you try to re-run the build?
It might be worth adding a check in case of a 404 if the installation was removed, and ignore in this case, but throw an error in another case.
I ran
const installationOctokit = new Octokit({
auth: {
id,
privateKey,
installationId: 5701088,
},
});
and got 404. Tried with a good installation id had no issues 😃 .
The rerun of had no issues either.
Another example 😃
Okay, I agree we should handle that error better.
I would suggest we check if the installation still exists in case of a 404, in case it doesn't, do nothing
hey @wei would you like to send a PR for this change?
I haven't gotten time to do it (just been ignoring the workflow failure emails). I can take a shot when I have some time~ 😜
no rush, it seems like you are the only one affected so far. I guess your pull app is just much more popular than our apps :D
Or people actually like your apps and don't uninstall it 😂
It seems like I haven't encountered this in the last many months so I have not spent any time on this : ) I'll put this in the back burner for now.