UNPKG

@pulumi/github

Version:

A Pulumi package for creating and managing github cloud resources.

94 lines 4.27 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.ActionsOrganizationPermissions = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * This resource allows you to create and manage GitHub Actions permissions within your GitHub enterprise organizations. * You must have admin access to an organization to use this resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; * * const example = new github.Repository("example", {name: "my-repository"}); * const test = new github.ActionsOrganizationPermissions("test", { * allowedActions: "selected", * enabledRepositories: "selected", * allowedActionsConfig: { * githubOwnedAllowed: true, * patternsAlloweds: [ * "actions/cache@*", * "actions/checkout@*", * ], * verifiedAllowed: true, * }, * enabledRepositoriesConfig: { * repositoryIds: [example.repoId], * }, * }); * ``` * * ## Import * * This resource can be imported using the name of the GitHub organization: * * ```sh * $ pulumi import github:index/actionsOrganizationPermissions:ActionsOrganizationPermissions test github_organization_name * ``` */ class ActionsOrganizationPermissions extends pulumi.CustomResource { /** * Get an existing ActionsOrganizationPermissions 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, id, state, opts) { return new ActionsOrganizationPermissions(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ActionsOrganizationPermissions. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === ActionsOrganizationPermissions.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["allowedActions"] = state ? state.allowedActions : undefined; resourceInputs["allowedActionsConfig"] = state ? state.allowedActionsConfig : undefined; resourceInputs["enabledRepositories"] = state ? state.enabledRepositories : undefined; resourceInputs["enabledRepositoriesConfig"] = state ? state.enabledRepositoriesConfig : undefined; } else { const args = argsOrState; if ((!args || args.enabledRepositories === undefined) && !opts.urn) { throw new Error("Missing required property 'enabledRepositories'"); } resourceInputs["allowedActions"] = args ? args.allowedActions : undefined; resourceInputs["allowedActionsConfig"] = args ? args.allowedActionsConfig : undefined; resourceInputs["enabledRepositories"] = args ? args.enabledRepositories : undefined; resourceInputs["enabledRepositoriesConfig"] = args ? args.enabledRepositoriesConfig : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ActionsOrganizationPermissions.__pulumiType, name, resourceInputs, opts); } } exports.ActionsOrganizationPermissions = ActionsOrganizationPermissions; /** @internal */ ActionsOrganizationPermissions.__pulumiType = 'github:index/actionsOrganizationPermissions:ActionsOrganizationPermissions'; //# sourceMappingURL=actionsOrganizationPermissions.js.map