@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
74 lines • 2.58 kB
JavaScript
// *** 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.getTreeOutput = exports.getTree = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Use this data source to retrieve information about a single tree.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const _this = github.getRepository({
* name: "example",
* });
* const thisGetBranch = Promise.all([_this, _this]).then(([_this, _this1]) => github.getBranch({
* branch: _this.defaultBranch,
* repository: _this1.name,
* }));
* const thisGetTree = Promise.all([_this, thisGetBranch]).then(([_this, thisGetBranch]) => github.getTree({
* recursive: false,
* repository: _this.name,
* treeSha: thisGetBranch.sha,
* }));
* export const entries = thisGetTree.then(thisGetTree => thisGetTree.entries);
* ```
*/
function getTree(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("github:index/getTree:getTree", {
"recursive": args.recursive,
"repository": args.repository,
"treeSha": args.treeSha,
}, opts);
}
exports.getTree = getTree;
/**
* Use this data source to retrieve information about a single tree.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const _this = github.getRepository({
* name: "example",
* });
* const thisGetBranch = Promise.all([_this, _this]).then(([_this, _this1]) => github.getBranch({
* branch: _this.defaultBranch,
* repository: _this1.name,
* }));
* const thisGetTree = Promise.all([_this, thisGetBranch]).then(([_this, thisGetBranch]) => github.getTree({
* recursive: false,
* repository: _this.name,
* treeSha: thisGetBranch.sha,
* }));
* export const entries = thisGetTree.then(thisGetTree => thisGetTree.entries);
* ```
*/
function getTreeOutput(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("github:index/getTree:getTree", {
"recursive": args.recursive,
"repository": args.repository,
"treeSha": args.treeSha,
}, opts);
}
exports.getTreeOutput = getTreeOutput;
//# sourceMappingURL=getTree.js.map
;