https://github.com/shelfio/gh-sdk
Convenient wrapper for GitHub API for automation tasks
https://github.com/shelfio/gh-sdk
automation github npm-package
Last synced: 7 months ago
JSON representation
Convenient wrapper for GitHub API for automation tasks
- Host: GitHub
- URL: https://github.com/shelfio/gh-sdk
- Owner: shelfio
- License: mit
- Created: 2020-01-29T14:40:01.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-05-31T00:26:55.000Z (8 months ago)
- Last Synced: 2025-05-31T11:05:52.115Z (8 months ago)
- Topics: automation, github, npm-package
- Language: TypeScript
- Homepage:
- Size: 312 KB
- Stars: 3
- Watchers: 21
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: license
Awesome Lists containing this project
README
# gh-sdk [](https://circleci.com/gh/shelfio/gh-sdk/tree/master)
> Convenient wrapper for GitHub API for automation tasks
## Install
```
$ yarn add @shelf/gh-sdk
```
## Usage
```js
import { approvePR, mergePR, listPrs, getUserOrgs } from "@shelf/gh-sdk";
approvePR({ owner: "shelf", repo: "api", pr: 3 });
assignReleaseLabelToPR("shelf", "api", 134);
getRepoMergeStrategies("shelf", "api");
createReleaseBranch({ owner: "shelf", repo: "api", version: "1.2.3", sha: "dev" }); // => ref 'refs/heads/release/v1.2.3` (refs/heads - for git link)
createReleaseLabel("shelf", "api");
createReleasePR({ owner: "shelf", repo: "api", version: "1.2.3", releaseTitle: "Good stuff" }); // => ref: 'release/v1.2.3`, title: Release v1.2.3: Good stuff
deleteBranch({ owner: "shelf", repo: "api", ref: "dev" });
extractRepoNameFromURL("https://github.com/shelfio/gh-sdk/pulls/5"); // => gh-sdk
getLatestBranchCommit({ owner: "shelf", repo: "api", branch: "dev" });
getLatestDevelopCommit({ owner: "shelf", repo: "api" }); // {branch: 'develop} as default
getLatestDevelopCommitSHA({ owner: "shelf", repo: "api" }); // => 'develop-branch-hash-string'
getPR({ owner: "shelf", repo: "api", pr: 3 });
getRepoBranch({ owner: "shelf", repo: "api", branch: "dev" });
getRepoBranches({ owner: "shelf", repo: "api" }); // => [, {branch}]
getRepoBranchesNames({ owner: "shelf", repo: "api" }); // => [, 'branch-ref']
getRepoLabels("shelf", "api");
getUserOrgs();
listClosedPRs({ owner: "shelf", searchText: "renovate" });
listOrgRepos({ org: "shelfio", type: "sources", skipArchived: true }); // => [, {repo}]
listPrs({ owner: "shelf", searchText: "renovate" });
mergePR({ owner: "shelf", repo: "api", pr: 3 });
updateRepoMergeStrategies({
owner: 'shelfio',
repo: 'api',
allowMergeCommits: false,
allowSquash: false,
allowRebase: true,
});
getOpenRepoPRsFromHuman('shelf', 'repo');
getCommitChecks('shelf', 'repo', 'sha');
getPRCommitRefsWithMessages('shelf', 'repo', 3);
```
## Publish
```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```
## License
MIT © [Shelf](https://shelf.io)