I am trying to create a project in a GitHub repository using the GitHub REST APIs. I have installed a GitHub app and am using the octokit library and nodejs is my programming language.
I have configured the app and given it all the necessary permissions to read/write projects, repositories etc. For repositories, i have enabled
I am able to list the repositories, branches etc successfully, but i am not able to list the projects neither am I able add any project to any of the repositories. I read in the notes that project can only be added if a project already exists in the repository. But even that has not worked. My code is as below
for await (const { octokit, installation } of app.eachInstallation.iterator()) {
const result = await octokit.request('POST /repos/{owner}/{repo}/projects', {
owner: owner,
repo: repo,
name: projectName
});
console.log("Project: ", result.data.name)
}
When i run this code, i get an error with message that "Projects are disabled for this repository".
data: {
message: 'Projects are disabled for this repository',
documentation_url: 'https://docs.github.com/v3/projects'
}
So after looking around this is what i have found