Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]: Add github_repository_topics resource #1845

Closed
1 task done
felixlut opened this issue Aug 17, 2023 · 0 comments · Fixed by #1846
Closed
1 task done

[FEAT]: Add github_repository_topics resource #1845

felixlut opened this issue Aug 17, 2023 · 0 comments · Fixed by #1846
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request

Comments

@felixlut
Copy link
Contributor

felixlut commented Aug 17, 2023

Describe the need

In my org we currently don't have all repos inside of Terraform, but we want to be able to control the repository topics on them to enforce certain standards. Currently setting the topics via Terraform is only possible when using the github_repository resource, which is too intrusive for my usecase (unless I make some magic with the ignore_changes argument).

Another use-case is also that you can use this resource to set some topics from a platform prospective, while still allowing your users the freedom to add their own topics on top. See example below

data "github_repository" "test" {
  name = "my-cool-repo"
}

resource "github_repository_topics" "test" {
    repository    = data.github_repository.test.name
    # this result in all topics that was manually put on the repo + the standard ones the platform team wants
    topics        = concat(data.github_repository.test.topics, [lower(data.github_repository.test.primary_language), "owner-team", "product-name"])
}

output "name" {
  value = github_repository_topics.test.topics
}

There are API endpoints for doing this: https://docs.github.com/en/enterprise-server@3.10/rest/repos/repos?apiVersion=2022-11-28

I can work on it

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@felixlut felixlut added Status: Triage This is being looked at and prioritized Type: Feature New feature or request labels Aug 17, 2023
@nickfloyd nickfloyd added Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Triage This is being looked at and prioritized labels Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants