Documentation ¶
Overview ¶
Package check provides all the required functions to perform bool checks on whether a PR and its user are valid to be auto approved.
Check is used to perform bool checks on whether a PR and its user are valid to be auto approved.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GitHubTeam ¶
GitHubTeam takes a GitHub token and a string containing the owner of the PR. It'll perform a lookup for the following: - The PR owner's GitHub user ID, denoted by the user var. - The org user ID, denoted by org. We could've hard coded this. - The team ID, denoted by teamId. It then performs a lookup and confirms if the user's ID appears in the team ID members. If so, this function returns true.
func ParsePR ¶
ParsePR takes a fileName argument defined by a GitHub action pipeline. It opens fileName and adds each line to a collection for parsing. The file in fileName is the output of a `git diff` command in a pull request. The function then checks the collection and returns true if numOfAdds >= 1 and the additions in the output of the `git diff` contain `+last_reviewed_on`.
Types ¶
This section is empty.