Organization Custom Role
This resource allows you to create and manage custom roles in a GitHub Organization for use in repositories.
Note: Custom roles are currently only available in GitHub Enterprise Cloud.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.OrganizationCustomRole;
import com.pulumi.github.OrganizationCustomRoleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new OrganizationCustomRole("example", OrganizationCustomRoleArgs.builder()
.baseRole("read")
.description("Example custom role that uses the read role as its base")
.permissions(
"add_assignee",
"add_label",
"bypass_branch_protection",
"close_issue",
"close_pull_request",
"mark_as_duplicate",
"create_tag",
"delete_issue",
"delete_tag",
"manage_deploy_keys",
"push_protected_branch",
"read_code_scanning",
"reopen_issue",
"reopen_pull_request",
"request_pr_review",
"resolve_dependabot_alerts",
"resolve_secret_scanning_alerts",
"view_secret_scanning_alerts",
"write_code_scanning")
.build());
}
}
Content copied to clipboard
Import
Custom roles can be imported using the id
of the role. The id
of the custom role can be found using the list custom roles in an organization API.
$ pulumi import github:index/organizationCustomRole:OrganizationCustomRole example 1234
Content copied to clipboard
Properties
Link copied to clipboard
The description for the custom role.
Link copied to clipboard
A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the list repository fine-grained permissions for an organization API.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard