Skip to content

[FEAT]: Add github_actions_organization_secret_repository resource #2759

@ylascombe

Description

@ylascombe

Describe the need

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 resource.

What is currently available:

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

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

Manage selection for an organization secret only for a repository 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 suggest 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:

SDK Version

No response

API Version

No response

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: FeatureNew feature or request

    Type

    No type

    Projects

    Status

    🆕 Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions