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.

Function Description
cliReporter Formats a rule report as used by the standalone CLI.
markdownReporter Formats a rule report as used by the GitHub Actions Workflow.
runOctoGuideRules Runs 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.
Interface Description
RunOctoGuideRulesOptions Settings for running runOctoGuideRules. Only entity is required.
RunOctoGuideRulesResult Returned data from running runOctoGuideRules.
CommentEntity A resolved comment entity from GitHub. Can be a comment on an issue, pull request, or discussion.
DiscussionEntity A resolved discussion entity from GitHub.
IssueEntity A resolved issue entity from GitHub.
PullRequestEntity A resolved pull request entity from GitHub.
RuleReport Violation report generated by a rule for a GitHub entity.
RuleReportData Report data for a specific RuleReport violation.
Rule Defines how to analyze entities for a single best practice.
RuleAbout Metadata about a rule, as used to define the rule.
RuleContext Shared context provided to rules when they run on an entity.
RuleOptions Options for a rule, as resolved for a run.
RuleOptionsRaw Options for a rule, as provided in rule and user settings.
Settings -
Type Alias Description
Entity A resolved entity retrieved from the GitHub API. Can be a comment, discussion, issue, or pull request.
RuleListener Rule property called if the rule is run on the corresponding entity type.
RuleReporter Context function for a rule to register a new violation.