Skip to content

Package API

The octoguide package to use the API is the same as the standalone CLI and its code is directly used by the GitHub Action.

For installation instruction see Installing the OctoGuide Package.

FunctionDescription
cliReporterFormats a rule report as used by the standalone CLI.
markdownReporterFormats a rule report as used by the GitHub Actions Workflow.
runOctoGuideRulesRuns OctoGuide’s rules to generate a list of reports for a GitHub entity. The entity can be provided as either a URL string (which will be fetched from the GitHub API) or pre-existing entity data.
InterfaceDescription
RunOctoGuideRulesOptionsSettings for running runOctoGuideRules. Only entity is required.
RunOctoGuideRulesResultReturned data from running runOctoGuideRules.
CommentEntityA resolved comment entity from GitHub. Can be a comment on an issue, pull request, or discussion.
DiscussionEntityA resolved discussion entity from GitHub.
IssueEntityA resolved issue entity from GitHub.
PullRequestEntityA resolved pull request entity from GitHub.
RuleReportViolation report generated by a rule for a GitHub entity.
RuleReportDataReport data for a specific RuleReport violation.
RuleDefines how to analyze entities for a single best practice.
RuleAboutMetadata about a rule, as used to define the rule.
RuleContextShared context provided to rules when they run on an entity.
Type AliasDescription
EntityA resolved entity retrieved from the GitHub API. Can be a comment, discussion, issue, or pull request.
RuleListenerRule property called if the rule is run on the corresponding entity type.
RuleReporterContext function for a rule to register a new violation.