Skip to content

Conversation

ylascombe
Copy link

Resolves #2759


Before the change?

Currently, the GitHub Terraform provider allows managing GitHub Actions secrets within your GitHub organization with github_actions_organization_secret resource,
it also allow to manage repository allow list for existing GitHub Actions secrets within your GitHub organization with actions_organization_secret_repositories

What is currently available:

resource "github_actions_organization_secret_repositories" "org_secret_repos" {
  secret_name = "existing_secret_name"
  selected_repository_ids = [
    123455,
    234567,
    345678,
  ]
}

After the change?

The provider do not yet allow to select/allow or unselect only one repo in the selected repos list.

Manage repo selection for organization secret can be useful when:

  • the terraform stack use do not known/manage all the repositories of the organization
  • we want to manage only a repository and we do not want to alter the other assignment.

So I propose in this PR to add a new resource to manage the addition (selection) or removal (unselection) for a GitHub Action Organization secret for a repo
Example

data "github_repository" "this" {
  full_name = "myorg/myrepo"
}

resource "github_actions_organization_secret_repository" "org_secret_repos" {
  secret_name = "EXAMPLE_SECRET_NAME"
  repository_id = github_repository.internal.repo_id
}

This feature would align with the GitHub API capabilities, where you can assign organization secrets:

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

No

Please see our docs on breaking changes to help!

  • Yes
  • No

@ylascombe ylascombe force-pushed the ylascombe/feat_add_resource_org_secret_repo branch from b3d65bb to 1d7e926 Compare September 18, 2025 18:57
@ylascombe ylascombe force-pushed the ylascombe/feat_add_resource_org_secret_repo branch from 1d7e926 to 8703f48 Compare September 18, 2025 19:09
@ylascombe ylascombe marked this pull request as ready for review September 18, 2025 19:10
@ylascombe ylascombe changed the title feat: Add github_actions_organization_secret_repository resource feat: add github_actions_organization_secret_repository resource Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT]: Add github_actions_organization_secret_repository resource
2 participants