UNPKG

@pulumi/github

Version:

A Pulumi package for creating and managing github cloud resources.

86 lines 3.99 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.ActionsOrganizationSecretRepositories = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * This resource allows you to manage repository allow list for existing GitHub Actions secrets within your GitHub organization. * You must have write access to an organization secret to use this resource. * * This resource is only applicable when `visibility` of the existing organization secret has been set to `selected`. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; * * const repo = github.getRepository({ * fullName: "my-org/repo", * }); * const orgSecretRepos = new github.ActionsOrganizationSecretRepositories("org_secret_repos", { * secretName: "existing_secret_name", * selectedRepositoryIds: [repo.then(repo => repo.repoId)], * }); * ``` * * ## Import * * This resource can be imported using an ID made up of the secret name: * * ```sh * $ pulumi import github:index/actionsOrganizationSecretRepositories:ActionsOrganizationSecretRepositories test_secret_repos test_secret_name * ``` */ class ActionsOrganizationSecretRepositories extends pulumi.CustomResource { /** * Get an existing ActionsOrganizationSecretRepositories 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 ActionsOrganizationSecretRepositories(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ActionsOrganizationSecretRepositories. 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'] === ActionsOrganizationSecretRepositories.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["secretName"] = state ? state.secretName : undefined; resourceInputs["selectedRepositoryIds"] = state ? state.selectedRepositoryIds : undefined; } else { const args = argsOrState; if ((!args || args.secretName === undefined) && !opts.urn) { throw new Error("Missing required property 'secretName'"); } if ((!args || args.selectedRepositoryIds === undefined) && !opts.urn) { throw new Error("Missing required property 'selectedRepositoryIds'"); } resourceInputs["secretName"] = args ? args.secretName : undefined; resourceInputs["selectedRepositoryIds"] = args ? args.selectedRepositoryIds : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ActionsOrganizationSecretRepositories.__pulumiType, name, resourceInputs, opts); } } exports.ActionsOrganizationSecretRepositories = ActionsOrganizationSecretRepositories; /** @internal */ ActionsOrganizationSecretRepositories.__pulumiType = 'github:index/actionsOrganizationSecretRepositories:ActionsOrganizationSecretRepositories'; //# sourceMappingURL=actionsOrganizationSecretRepositories.js.map