Skip to content

Commit da64043

Browse files
committed
Update documentation
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
1 parent 4cfd897 commit da64043

File tree

2 files changed

+66
-1
lines changed

2 files changed

+66
-1
lines changed

github/resource_github_actions_organization_workflow_permissions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type GithubActionsOrganizationWorkflowPermissionsErrorResponse struct {
2424

2525
func resourceGithubActionsOrganizationWorkflowPermissions() *schema.Resource {
2626
return &schema.Resource{
27-
Description: "GitHub Actions Organization Workflow Permissions management.",
27+
Description: "This resource allows you to manage GitHub Actions workflow permissions for a GitHub Organization account. This controls the default permissions granted to the GITHUB_TOKEN when running workflows and whether GitHub Actions can approve pull request reviews.\n\nYou must have organization admin access to use this resource.",
2828
CreateContext: resourceGithubActionsOrganizationWorkflowPermissionsCreateOrUpdate,
2929
ReadContext: resourceGithubActionsOrganizationWorkflowPermissionsRead,
3030
UpdateContext: resourceGithubActionsOrganizationWorkflowPermissionsCreateOrUpdate,
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
layout: "github"
3+
page_title: "GitHub: github_actions_organization_workflow_permissions"
4+
description: |-
5+
Manages GitHub Actions workflow permissions for a GitHub Organization.
6+
---
7+
8+
# github_actions_organization_workflow_permissions
9+
10+
This resource allows you to manage GitHub Actions workflow permissions for a GitHub Organization account. This controls the default permissions granted to the GITHUB_TOKEN when running workflows and whether GitHub Actions can approve pull request reviews.
11+
12+
You must have organization admin access to use this resource.
13+
14+
## Example Usage
15+
16+
```hcl
17+
# Basic workflow permissions configuration
18+
resource "github_actions_organization_workflow_permissions" "example" {
19+
organization_slug = "my-organization"
20+
21+
default_workflow_permissions = "read"
22+
can_approve_pull_request_reviews = false
23+
}
24+
25+
# Allow write permissions and PR approvals
26+
resource "github_actions_organization_workflow_permissions" "permissive" {
27+
organization_slug = "my-organization"
28+
29+
default_workflow_permissions = "write"
30+
can_approve_pull_request_reviews = true
31+
}
32+
```
33+
34+
## Argument Reference
35+
36+
The following arguments are supported:
37+
38+
* `organization_slug` - (Required) The slug of the organization.
39+
40+
* `default_workflow_permissions` - (Optional) The default workflow permissions granted to the GITHUB_TOKEN when running workflows. Can be `read` or `write`. Defaults to `read`.
41+
42+
* `can_approve_pull_request_reviews` - (Optional) Whether GitHub Actions can approve pull request reviews. Defaults to `false`.
43+
44+
## Attributes Reference
45+
46+
In addition to all arguments above, the following attributes are exported:
47+
48+
* `id` - The organization slug.
49+
50+
## Import
51+
52+
Organization Actions workflow permissions can be imported using the organization slug:
53+
54+
```sh
55+
terraform import github_actions_organization_workflow_permissions.example my-organization
56+
```
57+
58+
## Notes
59+
60+
~> **Note:** This resource requires a GitHub Organization account and organization admin permissions.
61+
62+
When this resource is destroyed, the workflow permissions will be reset to safe defaults:
63+
64+
* `default_workflow_permissions` = `read`
65+
* `can_approve_pull_request_reviews` = `false`

0 commit comments

Comments
 (0)