check

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2021 License: MIT Imports: 8 Imported by: 0

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

func GitHubTeam(team, orgOwner, token, prOwner string) (bool, error)

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

func ParsePR(fileName string) (bool, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL