-
Notifications
You must be signed in to change notification settings - Fork 984
doc(github_repository_webhook): Update GitHub repository webhook doc #3289
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
Open
ViacheslavKudinov
wants to merge
7
commits into
integrations:main
Choose a base branch
from
ViacheslavKudinov:doc/update-github-repository-webhook
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1287dd9
doc: Update github_repository_webhook doc
ViacheslavKudinov 2de4611
Merge branch 'main' into doc/update-github-repository-webhook
ViacheslavKudinov 199780c
doc: Update github_repository_webhook doc
ViacheslavKudinov 05a7f52
doc: Update github_repository_webhook doc
ViacheslavKudinov ca72df0
doc: Update github_repository_webhook doc
ViacheslavKudinov f92f26b
doc: Update github_repository_webhook doc
ViacheslavKudinov d6a0020
Merge branch 'main' into doc/update-github-repository-webhook
ViacheslavKudinov 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 hidden or 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
4 changes: 4 additions & 0 deletions
4
examples/resources/github_repository_webhook/import-by-string-id.tf
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| import { | ||
| to = github_repository_webhook.example_webhook | ||
| id = "example-repo/123456789" | ||
| } |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| terraform import github_repository_webhook.example_webhook example-repo/123456789 |
8 changes: 4 additions & 4 deletions
8
...resources/repository_webhook/example_1.tf → ...s/github_repository_webhook/resource-1.tf
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,55 +1,44 @@ | ||
| --- | ||
| page_title: "{{.Name}} ({{.Type}}) - {{.RenderedProviderName}}" | ||
| subcategory: "" | ||
| description: |- | ||
| Creates and manages repository webhooks within GitHub organizations or personal accounts | ||
| {{ .Description | plainmarkdown | trimspace | prefixlines " " }} | ||
| --- | ||
|
|
||
| # {{.Name}} ({{.Type}}) | ||
|
|
||
| This resource allows you to create and manage webhooks for repositories within your GitHub organization or personal account. | ||
| {{ .Description | trimspace }} | ||
|
|
||
| ~> **Note on Archived Repositories**: When a repository is archived, GitHub makes it read-only, preventing webhook modifications. If you attempt to destroy resources associated with archived repositories, the provider will gracefully handle the operation by logging an informational message and removing the resource from Terraform state without attempting to modify the archived repository. | ||
|
|
||
| ## Example Usage | ||
|
|
||
| {{ tffile "examples/resources/repository_webhook/example_1.tf" }} | ||
|
|
||
| ## Argument Reference | ||
|
|
||
| The following arguments are supported: | ||
|
|
||
| - `repository` - (Required) The repository of the webhook. | ||
|
|
||
| - `events` - (Required) A list of events which should trigger the webhook. See a list of [available events](https://developer.github.com/v3/activity/events/types/). | ||
|
|
||
| - `configuration` - (Required) Configuration block for the webhook. [Detailed below.](#configuration) | ||
| {{- if .HasExamples }} | ||
|
|
||
| - `active` - (Optional) Indicate if the webhook should receive events. Defaults to `true`. | ||
|
|
||
| ### configuration | ||
|
|
||
| - `url` - (Required) The URL of the webhook. | ||
|
|
||
| - `content_type` - (Required) The content type for the payload. Valid values are either `form` or `json`. | ||
|
|
||
| - `secret` - (Optional) The shared secret for the webhook. [See API documentation](https://developer.github.com/v3/repos/hooks/#create-a-hook). | ||
| ## Example Usage | ||
| {{ range .ExampleFiles }} | ||
| {{ tffile . }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| - `insecure_ssl` - (Optional) Insecure SSL boolean toggle. Defaults to `false`. | ||
| {{ .SchemaMarkdown | trimspace }} | ||
| {{- if or .HasImport .HasImportIDConfig }} | ||
|
|
||
| ## Attributes Reference | ||
| ## Import | ||
|
|
||
| The following additional attributes are exported: | ||
| Import is supported using the following syntax: | ||
| {{- end }} | ||
| {{- if .HasImportIDConfig }} | ||
|
|
||
| - `url` - URL of the webhook. This is a sensitive attribute because it may include basic auth credentials. | ||
| Repository webhooks can be imported using the `name` of the repository, combined with the `id` of the webhook, separated by a `/` character. The `id` of the webhook can be found in the URL of the webhook. For example: `"https://github.com/example-org/example-repo/settings/hooks/123456789"`, where `123456789` is the `id` of the webhook. | ||
|
|
||
| ## Import | ||
| In Terraform v1.5.0 and later, the [`import` block](https://developer.hashicorp.com/terraform/language/import) can be used with the `id` attribute, for example: | ||
|
|
||
| Repository webhooks can be imported using the `name` of the repository, combined with the `id` of the webhook, separated by a `/` character. The `id` of the webhook can be found in the URL of the webhook. For example: `"https://github.com/foo-org/foo-repo/settings/hooks/14711452"`. | ||
| {{tffile .ImportIDConfigFile }} | ||
| {{- end }} | ||
| {{- if .HasImport }} | ||
|
|
||
| Importing uses the name of the repository, as well as the ID of the webhook, e.g. | ||
| The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example: | ||
|
|
||
| ```shell | ||
| terraform import github_repository_webhook.terraform terraform/11235813 | ||
| ``` | ||
| {{codefile "shell" .ImportFile }} | ||
|
|
||
| If secret is populated in the webhook's configuration, the value will be imported as "********". | ||
| {{- end }} |
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.
@deiga how should we react on Copilot reviews ?
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.
@ViacheslavKudinov You review the comments and decide if they make sense. If you don't know, ask from other maintainers