Publish modules in the registry with Github Organization

Hi, I have created my account in Terraform registry using my Github User.

My Github user is also the owner of a Github Organization. I’m trying to publish a module from a repository owned by my Github organization. When I try to publish the module only repositories owned by my user are listed, no repositories from my Organization =( .

How can I do that?

Pd. The repository names start with terraform-*

3 Likes

This should help you out. :slight_smile:

Right, but that is for make it private. I want to make it public.

This worked for me. Go to the organizations settings in GitHub. About half way down the settings select “Third Party Access” and then enable third party access.

3 Likes

This topic is a bit old now, and I believe there’s no way to do it currently, but it would be awesome to be able to do it.

Anything like this expected in the future?

This is not what was asked.

Hi is there any update on this? I still don’t see an option to publish from my own organisation but I can publish the module from my own account.

+1 Trying to do this too

Hi all,

It is definitely possible to publish from an organization rather than a personal account. For example, here are two modules that are published from repositories that belong to organizations on GitHub:

However, the problem of the organizations being unlisted in the registry UI is familiar to me. It’s been a long while so I don’t remember the details, but I believe @wderezin’s idea is in the right direction: the Terraform Registry asks the GitHub API which organizations your account belongs to, but GitHub filters that answer based on whether your membership in each organization is “visible”.

I don’t work on the Terraform Registry so I’m not able to answer with certainty, but I peeped in the Terraform Registry source code (which I can see because I’m a HashiCorp employee, but I normally work on Terraform Core) and see that it’s using List repositories for the Authenticated User, which returns (per the docs):

repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership

The docs don’t mention anything about organization membership visibility, but I do remember that I needed to do something special to make my organization visibility public before the registry could use this API endpoint to discover the repositories in that organization.

That “Third Party Access” setting that @wderezin mentioned seems promising, but I can’t confirm whether that’s the trick because I don’t have any additional organizations associated with my GitHub account to test with.

Turn it off here

1 Like

Thanks @acauret !
In case anyone is wondering how to find this page, I found it from my personal settings page’s organizations settings which led me to a url like this:
https://github.com/ORG/REPO/settings/access