-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Handle the case when issue labels already exist #13182
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,16 +6,24 @@ description: |- | |
Provides a GitHub issue label resource. | ||
--- | ||
|
||
# github\_issue_label | ||
# github_issue_label | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I never really understood the point of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does nothing... Trust me lol. This is identical. |
||
|
||
Provides a GitHub issue label resource. | ||
|
||
This resource allows you to create and manage issue labels within your | ||
Github organization. | ||
|
||
Issue labels are keyed off of their "name", so pre-existing issue labels result | ||
in a 422 HTTP error if they exist outside of Terraform. Normally this would not | ||
be an issue, except new repositories are created with a "default" set of labels, | ||
and those labels easily conflict with custom ones. | ||
|
||
This resource will first check if the label exists, and then issue an update, | ||
otherwise it will create. | ||
|
||
## Example Usage | ||
|
||
``` | ||
```hcl | ||
# Create a new, red colored label | ||
resource "github_issue_label" "test_repo" { | ||
repository = "test-repo" | ||
|
@@ -29,5 +37,7 @@ resource "github_issue_label" "test_repo" { | |
The following arguments are supported: | ||
|
||
* `repository` - (Required) The GitHub repository | ||
|
||
* `name` - (Required) The name of the label. | ||
* `color` - (Required) A 6 character hex code, without the leading #, identifying the color of the label. | ||
|
||
* `color` - (Required) A 6 character hex code, **without the leading #**, identifying the color of the label. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll need to randomize this, but apparently the other tests here aren't randomized yet either, so I'll do it in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, I tried that. I used random_id, but random_id doesn't get compiled 😦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we usually generate the randomness within the test via helpers (https://github.com/hashicorp/terraform/tree/master/helper/acctest), intentionally to not couple providers like
random
with other ones.