1 | # ProbotKit
|
2 |
|
3 | [![CircleCI](https://circleci.com/gh/kevgo/probot-kit.svg?style=shield)](https://circleci.com/gh/kevgo/probot-kit)
|
4 |
|
5 | _A collection of high-level tools to build Github bots using [Probot](https://probot.github.io)._
|
6 |
|
7 | <a textrun="all-exported">
|
8 |
|
9 | - **[downloadPullrequestPatch](src/download-pullrequest-patch.ts)** <br>
|
10 | downloads the patch for the given pull request
|
11 |
|
12 | - **[findPatchLine](src/find-patch-line.ts)** <br>
|
13 | Takes a line number in a file and a patch downloaded by the downloadPatch function.
|
14 | Returns the line number that Github expects for comments on this patch
|
15 | according to https://developer.github.com/v3/pulls/comments/#create-a-comment.
|
16 | Returns `undefined` if the patch doesn't contain the given line number.
|
17 |
|
18 | * **[getBranchName](src/get-branch-name.ts)** <br>
|
19 | determines the name of the branch involved in the given Github event
|
20 |
|
21 | * **[getCommitAuthorName](src/get-commit-author-name.ts)** <br>
|
22 | returns the username for the head commit of the given Github event
|
23 |
|
24 | * **[getRepoBranchSha](src/get-repo-branch-sha.ts)** <br>
|
25 | returns the name of the repository in which the activity described by the context happens,
|
26 | in the format {repoName}/{branchName}
|
27 |
|
28 | * **[getRepoName](src/get-repo-name.ts)** <br>
|
29 | returns the name of the repository in which the activity described by the context happens
|
30 |
|
31 | * **[getSha](src/get-sha.ts)** <br>
|
32 | returns the SHA1 of the head commit for the given Github event
|
33 |
|
34 | * **[iterateCurrentCommitFiles](src/iterate-current-commit-files.ts)** <br>
|
35 | iterates all files of the current commit
|
36 |
|
37 | * **[loadBotConfig](src/load-bot-config.ts)** <br>
|
38 | Loads and parses the bot configuration file with the given name from the repo on Github.
|
39 | The file is assumed to be in YML format.
|
40 |
|
41 | * **[loadFile](src/load-file.ts)** <br>
|
42 | Loads the given file from GitHub.
|
43 | Returns the content and the SHA.
|
44 |
|
45 | * **[updateFile](src/update-file.ts)** <br>
|
46 | updates the file with the given name to the given content in the given branch
|
47 |
|
48 | </a>
|