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 | * **[getRepoBranchName](src/get-repo-branch-name.ts)** <br>
|
22 | returns the name of the repository in which the activity described by the context happens,
|
23 | in the format {repoName}/{branchName}
|
24 |
|
25 | * **[getRepoName](src/get-repo-name.ts)** <br>
|
26 | Returns the name of the repository in which the activity described by the context happens
|
27 |
|
28 | * **[iterateCurrentCommitFiles](src/iterate-current-commit-files.ts)** <br>
|
29 | iterates all files of the current commit
|
30 |
|
31 | * **[loadBotConfig](src/load-bot-config.ts)** <br>
|
32 | Loads and parses the bot configuration file with the given name from the repo on Github.
|
33 | The file is assumed to be in YML format.
|
34 |
|
35 | * **[loadFile](src/load-file.ts)** <br>
|
36 | Loads the given file from GitHub.
|
37 | Returns the content and the SHA.
|
38 |
|
39 | * **[updateFile](src/update-file.ts)** <br>
|
40 | updates the file with the given name to the given content in the given branch
|
41 |
|
42 | </a>
|