-
Notifications
You must be signed in to change notification settings - Fork 859
Description
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:
- either to all repos: https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#set-selected-repositories-for-an-organization-secret
- or only a repo: https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#add-selected-repository-to-an-organization-secret
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
Labels
Type
Projects
Status