terraform-provider-github icon indicating copy to clipboard operation
terraform-provider-github copied to clipboard

Not able to create GitHub Organization Project

Open tracphil opened this issue 2 years ago • 8 comments
trafficstars

Hi,

I am not able to create an organization project. It is throwing this error.

Error: POST https://api.github.com/orgs/my-org/projects: 410 Projects are disabled for this organization []

This is my code for reference:

terraform {
  required_version = ">= 1.4.0, < 2.0.0"

  required_providers {
    github = {
      source  = "integrations/github"
      version = "~> 5.0"
    }
  }
}

// Provider items are being passed through environment variables.

resource "github_organization_project" "this" {
  for_each = var.organization_project

  name = each.value["name"]
  body = each.value["body"]
}

SDK Version No response

API Version No response

Relevant log output

 Error: POST https://api.github.com/orgs/my-org/projects: 410 Projects are disabled for this organization []

   with module.organization.github_organization_project.main["org-project"],
   on ../../terraform/terraform-github-organization/main.tf line 64, in resource "github_organization_project" "main":
   64: resource "github_organization_project" "main" {

Under Code, planning, and automation in Organization settings, I have "checked" Enable Projects for the organization

tracphil avatar May 14 '23 11:05 tracphil

Any development for this?

powhapki avatar Jun 28 '23 09:06 powhapki

Any development for this?

No. I am still waiting on it to be fixed.

tracphil avatar Jul 03 '23 13:07 tracphil

Any development for this?

No. I am still waiting on it to be fixed.

Is there anything I can help?

powhapki avatar Jul 06 '23 03:07 powhapki

PRs are appreciated!

kfcampbell avatar Jul 06 '23 20:07 kfcampbell

Now that classic projects are no longer available (at least to users that didn't already create one), would this bug be resolved by migrating this feature to the GraphQL endpoint instead of the REST API?

I see other resources are already managed with GraphQL.

Also, moving to graphQL may mean a breaking change. Unless we want to have github_organization_project for classic and github_organization_project_v2 for the new implementation, which sounds off considering the "new" implementation is just called "Projects".

HectorCastelli avatar Jan 04 '24 08:01 HectorCastelli

Still not working as of version 6.2.3. Appreciate any update on the progress of it. Thanks

sabpamdev1 avatar Aug 30 '24 12:08 sabpamdev1

same here. since classic projects are not available anymore, we have no way to automate the creation of projects now.

muhlba91 avatar Sep 18 '24 07:09 muhlba91

A not so great workaround is to achieve this through running custom code (using python or JS, for example) for creation of GitHub Projects V2 using GitHub graphQL API; Get that triggered using TF's null_resource and local_exec provisioner. This gets the job done but because its through a null_resource TF state won't know anything about it.

sabpamdev1 avatar Sep 20 '24 15:09 sabpamdev1

I tried to create the project on GitHub.com and import it using:

terraform import github_organization_project.my_project 3

Unfortunately, this imports not project 3 but project 1 (which was deleted), see the url:

# github_organization_project.my_project:
resource "github_organization_project" "my_project" {
    body = "this is my project"
    etag = "..."
    id   = "3"
    name = "time to project 🐠🐟🌊"
    url  = "https://github.com/orgs/my-org/projects/1"
}

igorakkerman avatar Nov 20 '24 17:11 igorakkerman

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

github-actions[bot] avatar Aug 18 '25 02:08 github-actions[bot]

This should remain open and be fixed.

igorakkerman avatar Aug 18 '25 11:08 igorakkerman