Skip to content

GitHub Standalone integration with GitHub App not working #142

@yaronpri

Description

@yaronpri

Hi,
When using a GitHub Standalone instance, the integration with Github App is not working, getting -

undefined
If .env file is modified ...

After reading this doc - where it says:

There is one case where an OAuth app is preferred over a GitHub App. If your app needs to access enterprise-level resources such as the enterprise object itself, you should use an OAuth app because a GitHub App cannot yet be given permissions against an enterprise.

I was able to fix the issue by:

  1. Created a OAuth App instead.
  2. Add the scope I would like to get access to as part of the authorization request - server.mjs
res.redirect(`https://github.com/login/oauth/authorize?client_id=${process.env.GITHUB_CLIENT_ID}&redirect_uri=${redirectUrl}&state=${req.session.state}&scope=user%20read:org%20read:enterprise%20copilot:manage_billing%20read:enterprise_billing`);

By doing the following I was able to read the metrics after performing GitHub login.

I am opening this as an issue as maybe there is better way to fix this.
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions