@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
199 lines (198 loc) • 7.18 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Creates a GitHub repository ruleset.
*
* This resource allows you to create and manage rulesets on the repository level. When applied, a new ruleset will be created. When destroyed, that ruleset will be removed.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const example = new github.Repository("example", {
* name: "example",
* description: "Example repository",
* });
* const exampleRepositoryRuleset = new github.RepositoryRuleset("example", {
* name: "example",
* repository: example.name,
* target: "branch",
* enforcement: "active",
* conditions: {
* refName: {
* includes: ["~ALL"],
* excludes: [],
* },
* },
* bypassActors: [{
* actorId: 13473,
* actorType: "Integration",
* bypassMode: "always",
* }],
* rules: {
* creation: true,
* update: true,
* deletion: true,
* requiredLinearHistory: true,
* requiredSignatures: true,
* requiredDeployments: {
* requiredDeploymentEnvironments: ["test"],
* },
* },
* });
* ```
*
* ## Import
*
* GitHub Repository Rulesets can be imported using the GitHub repository name and ruleset ID e.g.
*
* ```sh
* $ pulumi import github:index/repositoryRuleset:RepositoryRuleset example example:12345`
* ```
*/
export declare class RepositoryRuleset extends pulumi.CustomResource {
/**
* Get an existing RepositoryRuleset 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<pulumi.ID>, state?: RepositoryRulesetState, opts?: pulumi.CustomResourceOptions): RepositoryRuleset;
/**
* Returns true if the given object is an instance of RepositoryRuleset. 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 RepositoryRuleset;
/**
* (Block List) The actors that can bypass the rules in this ruleset. (see below for nested schema)
*/
readonly bypassActors: pulumi.Output<outputs.RepositoryRulesetBypassActor[] | undefined>;
/**
* (Block List, Max: 1) Parameters for a repository ruleset ref name condition. (see below for nested schema)
*/
readonly conditions: pulumi.Output<outputs.RepositoryRulesetConditions | undefined>;
/**
* (String) Possible values for Enforcement are `disabled`, `active`, `evaluate`. Note: `evaluate` is currently only supported for owners of type `organization`.
*/
readonly enforcement: pulumi.Output<string>;
/**
* (String)
*/
readonly etag: pulumi.Output<string>;
/**
* (String) The name of the ruleset.
*/
readonly name: pulumi.Output<string>;
/**
* (String) GraphQL global node id for use with v4 API.
*/
readonly nodeId: pulumi.Output<string>;
/**
* (String) Name of the repository to apply rulset to.
*/
readonly repository: pulumi.Output<string | undefined>;
/**
* (Block List, Min: 1, Max: 1) Rules within the ruleset. (see below for nested schema)
*/
readonly rules: pulumi.Output<outputs.RepositoryRulesetRules>;
/**
* (Number) GitHub ID for the ruleset.
*/
readonly rulesetId: pulumi.Output<number>;
/**
* (String) Possible values are `branch` and `tag`.
*/
readonly target: pulumi.Output<string>;
/**
* Create a RepositoryRuleset 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: RepositoryRulesetArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering RepositoryRuleset resources.
*/
export interface RepositoryRulesetState {
/**
* (Block List) The actors that can bypass the rules in this ruleset. (see below for nested schema)
*/
bypassActors?: pulumi.Input<pulumi.Input<inputs.RepositoryRulesetBypassActor>[]>;
/**
* (Block List, Max: 1) Parameters for a repository ruleset ref name condition. (see below for nested schema)
*/
conditions?: pulumi.Input<inputs.RepositoryRulesetConditions>;
/**
* (String) Possible values for Enforcement are `disabled`, `active`, `evaluate`. Note: `evaluate` is currently only supported for owners of type `organization`.
*/
enforcement?: pulumi.Input<string>;
/**
* (String)
*/
etag?: pulumi.Input<string>;
/**
* (String) The name of the ruleset.
*/
name?: pulumi.Input<string>;
/**
* (String) GraphQL global node id for use with v4 API.
*/
nodeId?: pulumi.Input<string>;
/**
* (String) Name of the repository to apply rulset to.
*/
repository?: pulumi.Input<string>;
/**
* (Block List, Min: 1, Max: 1) Rules within the ruleset. (see below for nested schema)
*/
rules?: pulumi.Input<inputs.RepositoryRulesetRules>;
/**
* (Number) GitHub ID for the ruleset.
*/
rulesetId?: pulumi.Input<number>;
/**
* (String) Possible values are `branch` and `tag`.
*/
target?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a RepositoryRuleset resource.
*/
export interface RepositoryRulesetArgs {
/**
* (Block List) The actors that can bypass the rules in this ruleset. (see below for nested schema)
*/
bypassActors?: pulumi.Input<pulumi.Input<inputs.RepositoryRulesetBypassActor>[]>;
/**
* (Block List, Max: 1) Parameters for a repository ruleset ref name condition. (see below for nested schema)
*/
conditions?: pulumi.Input<inputs.RepositoryRulesetConditions>;
/**
* (String) Possible values for Enforcement are `disabled`, `active`, `evaluate`. Note: `evaluate` is currently only supported for owners of type `organization`.
*/
enforcement: pulumi.Input<string>;
/**
* (String) The name of the ruleset.
*/
name?: pulumi.Input<string>;
/**
* (String) Name of the repository to apply rulset to.
*/
repository?: pulumi.Input<string>;
/**
* (Block List, Min: 1, Max: 1) Rules within the ruleset. (see below for nested schema)
*/
rules: pulumi.Input<inputs.RepositoryRulesetRules>;
/**
* (String) Possible values are `branch` and `tag`.
*/
target: pulumi.Input<string>;
}