INNER CODE UNIT · JavaScript

getTokenFromOwner

actions/create-github-app-token · lib/main.js:218

async function getTokenFromOwner(request, auth, parsedOwner, permissions) {
  // https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-user-installation-for-the-authenticated-app
  // This endpoint works for both users and organizations
  const response = await request("GET /users/{username}/installation", {
    username: parsedOwner,
    request: {
      hook: auth.hook,
    },
  });

  // Get token for all repositories of the given installation
  return createInstallationAuthResult(auth, response.data, permissions);
}

async function getTokenFromRepository(
  request,
  auth,
  parsedOwner,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…