Transferring git repository using REST API fails

175 Views Asked by At

I'm trying to achieve Github repo transfer (on both private and public repos) via their REST API. For this I have tried the below options

  1. With Github App and Oktokit

    const app = new App({ appId: <App_Id>, privateKey: <Private_Key>, });

    const octokit = await app.getInstallationOctokit(<Installation_Id>);

    let data = await octokit.request("POST /repos/{owner}/{repo}/transfer", { owner, new_owner, new_name })

Error: "Resource not accessible by integration"

  1. Github PAT token and Octokit

    const octokit = new Octokit({auth: "<PAT_Token>"});

    const response = await octokit.rest.repos.transfer({ owner, repo, new_owner });

Error: "Resource not accessible by personal access token"

  1. Tried with Plain curl URL as well; however no luck, similar error response.

For Github App

For Github PAT

I have given all permission for this test drive. no luck!

Am I missing anything here? I would appreciate any help on this.

0

There are 0 best solutions below