import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Protects a GitHub branch. * * The `github.BranchProtection` resource has moved to the GraphQL API, while this resource will continue to leverage the REST API. * * This resource allows you to configure branch protection for repositories in your organization. When applied, the branch will be protected from forced pushes and deletion. Additional constraints, such as required status checks or restrictions on users, teams, and apps, can also be configured. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; * * // Protect the main branch of the foo repository. Only allow a specific user to merge to the branch. * const example = new github.BranchProtectionV3("example", { * repository: exampleGithubRepository.name, * branch: "main", * restrictions: { * users: ["foo-user"], * }, * }); * ``` * * ## Import * * GitHub Branch Protection can be imported using an ID made up of `repository:branch`, e.g. * * ```sh * $ pulumi import github:index/branchProtectionV3:BranchProtectionV3 terraform terraform:main * ``` */ export declare class BranchProtectionV3 extends pulumi.CustomResource { /** * Get an existing BranchProtectionV3 resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: BranchProtectionV3State, opts?: pulumi.CustomResourceOptions): BranchProtectionV3; /** * Returns true if the given object is an instance of BranchProtectionV3. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is BranchProtectionV3; /** * The Git branch to protect. */ readonly branch: pulumi.Output; /** * Boolean, setting this to `true` enforces status checks for repository administrators. */ readonly enforceAdmins: pulumi.Output; readonly etag: pulumi.Output; /** * The GitHub repository name. */ readonly repository: pulumi.Output; /** * Boolean, setting this to `true` requires all conversations on code must be resolved before a pull request can be merged. */ readonly requireConversationResolution: pulumi.Output; /** * Boolean, setting this to `true` requires all commits to be signed with GPG. */ readonly requireSignedCommits: pulumi.Output; /** * Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. */ readonly requiredPullRequestReviews: pulumi.Output; /** * Enforce restrictions for required status checks. See Required Status Checks below for details. */ readonly requiredStatusChecks: pulumi.Output; /** * Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. */ readonly restrictions: pulumi.Output; /** * Create a BranchProtectionV3 resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: BranchProtectionV3Args, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering BranchProtectionV3 resources. */ export interface BranchProtectionV3State { /** * The Git branch to protect. */ branch?: pulumi.Input; /** * Boolean, setting this to `true` enforces status checks for repository administrators. */ enforceAdmins?: pulumi.Input; etag?: pulumi.Input; /** * The GitHub repository name. */ repository?: pulumi.Input; /** * Boolean, setting this to `true` requires all conversations on code must be resolved before a pull request can be merged. */ requireConversationResolution?: pulumi.Input; /** * Boolean, setting this to `true` requires all commits to be signed with GPG. */ requireSignedCommits?: pulumi.Input; /** * Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. */ requiredPullRequestReviews?: pulumi.Input; /** * Enforce restrictions for required status checks. See Required Status Checks below for details. */ requiredStatusChecks?: pulumi.Input; /** * Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. */ restrictions?: pulumi.Input; } /** * The set of arguments for constructing a BranchProtectionV3 resource. */ export interface BranchProtectionV3Args { /** * The Git branch to protect. */ branch: pulumi.Input; /** * Boolean, setting this to `true` enforces status checks for repository administrators. */ enforceAdmins?: pulumi.Input; /** * The GitHub repository name. */ repository: pulumi.Input; /** * Boolean, setting this to `true` requires all conversations on code must be resolved before a pull request can be merged. */ requireConversationResolution?: pulumi.Input; /** * Boolean, setting this to `true` requires all commits to be signed with GPG. */ requireSignedCommits?: pulumi.Input; /** * Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. */ requiredPullRequestReviews?: pulumi.Input; /** * Enforce restrictions for required status checks. See Required Status Checks below for details. */ requiredStatusChecks?: pulumi.Input; /** * Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. */ restrictions?: pulumi.Input; }