You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/r/repository_autolink_reference.html.markdown
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,12 @@ description: |-
9
9
10
10
This resource allows you to create and manage an autolink reference for a single repository.
11
11
12
+
When a `github_repository_autolink_reference` resource is created, the provider first checks whether an autolink with the same `key_prefix` already exists in the repository:
13
+
14
+
* If one exists **with identical settings**, it is imported into Terraform state rather than creating a duplicate (the GitHub API would otherwise return an error).
15
+
* If one exists **with different settings** (`target_url_template` or `is_alphanumeric`), the existing autolink is deleted and recreated with the desired configuration.
16
+
* If none exists, the autolink is created normally.
17
+
12
18
## Example Usage
13
19
14
20
```hcl
@@ -34,7 +40,7 @@ The following arguments are supported:
34
40
35
41
*`repository` - (Required) The repository of the autolink reference.
36
42
37
-
*`key_prefix` - (Required) This prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.
43
+
*`key_prefix` - (Required) This prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit. If an autolink reference with this key prefix already exists, the provider imports it when the settings match, or replaces it when the settings differ.
38
44
39
45
*`target_url_template` - (Required) The template of the target URL used for the links; must be a valid URL and contain `<num>` for the reference number
0 commit comments