Lighthouse-ci: How to recover lost LHCI_GITHUB_APP_TOKEN

Created on 13 Nov 2019  路  6Comments  路  Source: GoogleChrome/lighthouse-ci

Is there any way to find the LHCI_GITHUB_APP_TOKEN once you close the authorization confirmation page? 馃槃

I can't find it in the documentation.
This would be a good question to add to the FAQ.

Most helpful comment

Hey folks sorry for the troubles here! A couple notes:

  1. Sounds like a few of you are already know this, but some logs suggest it's worth noting again... If you're using the GitHub App you need to be using the LHCI_GITHUB_APP_TOKEN or --githubAppToken not --githubToken or LHCI_GITHUB_TOKEN, and vice-versa if you're using direct status checks with a personal GitHub access token. There are two different methods of status check support and accidentally using the wrong flag/token leads to the 422 error. We'll try to make this clearer in the docs.
  2. We were being a little too strict about what URLs you're allowed to link to from the status checks which also leads to 422. We just pushed an update to the app service that should fallback to a generic docs link in this situation, so things should be working here now as well.
  3. There's no way to retrieve the token if you've lost it. Just uninstalling and reinstalling the app is the right move. We'll add this to the FAQs 馃憤

All 6 comments

I believe you need to remove the app from Github and then reinstall it

Thanks, I have it again.

Now that I have it, the status isn't being updated. 馃槩

This is the log:

GitHub token found, attempting to set status...
GitHub responded with 422
{"success":false}

Any ideas why?

Now that I have it, the status isn't being updated. 馃槩

This is the log:

GitHub token found, attempting to set status...
GitHub responded with 422
{"success":false}

Any ideas why?

We're having the same problem in a private repo. Gave the github app org access to only the specific repo, but it's not working, with the exact same error.

I'm having the problem too.

Hey folks sorry for the troubles here! A couple notes:

  1. Sounds like a few of you are already know this, but some logs suggest it's worth noting again... If you're using the GitHub App you need to be using the LHCI_GITHUB_APP_TOKEN or --githubAppToken not --githubToken or LHCI_GITHUB_TOKEN, and vice-versa if you're using direct status checks with a personal GitHub access token. There are two different methods of status check support and accidentally using the wrong flag/token leads to the 422 error. We'll try to make this clearer in the docs.
  2. We were being a little too strict about what URLs you're allowed to link to from the status checks which also leads to 422. We just pushed an update to the app service that should fallback to a generic docs link in this situation, so things should be working here now as well.
  3. There's no way to retrieve the token if you've lost it. Just uninstalling and reinstalling the app is the right move. We'll add this to the FAQs 馃憤
Was this page helpful?
0 / 5 - 0 ratings