1

I'm trying to fetch projects from a github repo using PyGithub 1.58.1.

I created those projects manually in browser and I can see them. 

But when I see repo.get_projects().totalCount, it's giving 0

and when I try to create a project, it says

github.GithubException.GithubException: 410 {"message": "Projects are disabled for this repository", "documentation_url": "https://docs.github.com/v3/projects"}

But I see repo.has_projects returning True

Same issue when using curl as well.

The PAT I'm using contains all the permissions in the settings page.

What am I missing here?

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Underoos
  • 4,708
  • 8
  • 42
  • 85
  • 1
    Could this be down to pygithub only supporting classic projects? I don't think you can create classic projects anymore. – Dustin Wyatt Apr 17 '23 at 19:20
  • 1
    https://stackoverflow.com/questions/73268885/unable-to-create-project-in-repository-or-organisation-using-github-rest-api – Dustin Wyatt Apr 17 '23 at 19:26
  • @DustinWyatt Yes. That's the same response I got from github support too. – Underoos Apr 18 '23 at 05:32
  • 1
    Here's some code I wrote yesterday for doing this: https://gist.github.com/dmwyatt/efaf240205d0f48b2d593f45a721f5b9 – Dustin Wyatt Apr 18 '23 at 14:59
  • @DustinWyatt Looks good for getting just the short information about project. Is there a way to recreate these whole projects in a new repo? and Thanks in advance btw. – Underoos Apr 20 '23 at 14:26
  • 1
    I'm really just learning the API as I go along. I think you should be able to do that, but you'll have to explore the GraphQL API with their explorer tool here: https://docs.github.com/en/graphql/overview/explorer It's good, but not super-intuitive either. Make sure you check out the buttons along the top side, and if you hover over keywords in the editor, you get a docs popup that you can click keywords inside of. – Dustin Wyatt Apr 21 '23 at 15:42

0 Answers0