{"modulePath":"github.com/tobiash/gitops-preview-toolkit","version":"v0.2.0-rc.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package githubaction\n\n## Constants\n\n```go\nconst (\n\tStatusClean   = \"clean\"\n\tStatusChanged = \"changed\"\n\tStatusWarning = \"warning\"\n\tStatusError   = \"error\"\n)\n```\nStatus values for ActionReport.\n\n## Functions\n\n```go\nfunc RenderCommentMarkdown(req *Request, report *ActionReport) string\n```\nRenderCommentMarkdown generates a PR comment markdown document.\n\n```go\nfunc RenderHTMLReport(data HTMLReportData) (string, error)\n```\n\n```go\nfunc RenderSummaryMarkdown(req *Request, report *ActionReport) string\n```\nRenderSummaryMarkdown generates a GitHub Step Summary markdown document.\n\n```go\nfunc StatusFromCounts(changed bool, warnings int, errors int) string\n```\nStatusFromCounts derives the overall status from changes, warnings, and errors.\n\n```go\nfunc StringSlice(v []string) []string\n```\nStringSlice returns a stable string slice for use in markdown tables.\n\n```go\nfunc TruncateDiff(full string, maxBytes, maxLines int) (preview string, truncated bool)\n```\nTruncateDiff produces a preview-safe diff string respecting size and line limits.\n\n## Types\n\n```go\ntype ActionReport struct {\n\tStatus   string   `json:\"status\"`\n\tChanged  bool     `json:\"changed\"`\n\tWarnings []string `json:\"warnings,omitempty\"`\n\tErrors   []string `json:\"errors,omitempty\"`\n\n\tDiffBytes     int    `json:\"diff_bytes\"`\n\tDiffTruncated bool   `json:\"diff_truncated\"`\n\tDiffPreview   string `json:\"diff_preview,omitempty\"`\n\n\tDiffFile       string `json:\"diff_file,omitempty\"`\n\tSummaryFile    string `json:\"summary_file,omitempty\"`\n\tCommentFile    string `json:\"comment_file,omitempty\"`\n\tReportFile     string `json:\"report_file,omitempty\"`\n\tHTMLReportFile string `json:\"html_report_file,omitempty\"`\n\tExportDir      string `json:\"export_dir,omitempty\"`\n\n\tResourcesAdded    int `json:\"resources_added\"`\n\tResourcesModified int `json:\"resources_modified\"`\n\tResourcesDeleted  int `json:\"resources_deleted\"`\n\tResourcesTotal    int `json:\"resources_total\"`\n\n\tByKind        map[string]int                  `json:\"by_kind,omitempty\"`\n\tKindBreakdown map[string]diff.ChangeBreakdown `json:\"kind_breakdown,omitempty\"`\n\tByProducer    map[string]int                  `json:\"by_producer,omitempty\"`\n\tByCluster     map[string]diff.ChangeBreakdown `json:\"by_cluster,omitempty\"`\n\n\tClassifications []policy.Classification `json:\"classifications,omitempty\"`\n\tViolations      []policy.Violation      `json:\"violations,omitempty\"`\n\tLabels          []string                `json:\"labels,omitempty\"`\n\tPolicyFailures  []string                `json:\"policy_failures,omitempty\"`\n\tPolicyFailed    bool                    `json:\"policy_failed\"`\n\tAIAssessment    *ai.Assessment          `json:\"ai_assessment,omitempty\"`\n}\n```\nActionReport is the structured result of a GitHub Action run.\n\n```go\nfunc BuildReport(input ReportInput) *ActionReport\n```\nBuildReport assembles the shared impact report used by CLI and GitHub Action adapters.\n\n```go\ntype ChangeBreakdown = diff.ChangeBreakdown\n```\nChangeBreakdown is an alias for diff.ChangeBreakdown for backward compatibility.\n\n```go\ntype HTMLDiffRow struct {\n\tType    string `json:\"type\"`\n\tOldLine int    `json:\"oldLine,omitempty\"`\n\tNewLine int    `json:\"newLine,omitempty\"`\n\tOldText string `json:\"oldText,omitempty\"`\n\tNewText string `json:\"newText,omitempty\"`\n}\n```\n\n```go\ntype HTMLReportData struct {\n\tMeta      HTMLReportMeta       `json:\"meta\"`\n\tSummary   HTMLReportSummary    `json:\"summary\"`\n\tPolicies  HTMLReportPolicies   `json:\"policies\"`\n\tAI        *ai.Assessment       `json:\"ai,omitempty\"`\n\tResources []HTMLResourceChange `json:\"resources\"`\n}\n```\n\n```go\nfunc BuildHTMLReportData(req *Request, report *ActionReport, result *fmpdiff.DiffResult) HTMLReportData\n```\n\n```go\ntype HTMLReportMeta struct {\n\tStatus        string   `json:\"status\"`\n\tGeneratedAt   string   `json:\"generatedAt\"`\n\tBase          string   `json:\"base\"`\n\tTarget        string   `json:\"target\"`\n\tWarnings      []string `json:\"warnings,omitempty\"`\n\tDiffBytes     int      `json:\"diffBytes\"`\n\tDiffTruncated bool     `json:\"diffTruncated\"`\n}\n```\n\n```go\ntype HTMLReportPolicies struct {\n\tClassifications []policy.Classification `json:\"classifications,omitempty\"`\n\tViolations      []policy.Violation      `json:\"violations,omitempty\"`\n\tLabels          []string                `json:\"labels,omitempty\"`\n\tPolicyFailures  []string                `json:\"policyFailures,omitempty\"`\n\tPolicyFailed    bool                    `json:\"policyFailed\"`\n}\n```\n\n```go\ntype HTMLReportSummary struct {\n\tAdded            int                        `json:\"added\"`\n\tModified         int                        `json:\"modified\"`\n\tDeleted          int                        `json:\"deleted\"`\n\tTotal            int                        `json:\"total\"`\n\tKindBreakdown    map[string]ChangeBreakdown `json:\"kindBreakdown,omitempty\"`\n\tClusterBreakdown map[string]ChangeBreakdown `json:\"clusterBreakdown,omitempty\"`\n}\n```\n\n```go\ntype HTMLResourceChange struct {\n\tIndex        int           `json:\"index\"`\n\tID           string        `json:\"id\"`\n\tAction       string        `json:\"action\"`\n\tCluster      string        `json:\"cluster\"`\n\tAPIVersion   string        `json:\"apiVersion\"`\n\tKind         string        `json:\"kind\"`\n\tNamespace    string        `json:\"namespace\"`\n\tName         string        `json:\"name\"`\n\tLogicalID    string        `json:\"logicalId,omitempty\"`\n\tSlot         string        `json:\"slot,omitempty\"`\n\tProducer     string        `json:\"producer\"`\n\tAddedLines   int           `json:\"addedLines\"`\n\tDeletedLines int           `json:\"deletedLines\"`\n\tDiffRows     []HTMLDiffRow `json:\"diffRows\"`\n\tTruncated    bool          `json:\"truncated,omitempty\"`\n}\n```\n\n```go\ntype ReportInput struct {\n\tResult             *diff.DiffResult\n\tPolicyResult       *policy.Result\n\tWarnings           []string\n\tFullDiff           string\n\tMaxInlineDiffBytes int\n\tDiffPreviewLines   int\n\tAIAssessment       *ai.Assessment\n}\n```\nReportInput contains the domain data needed to assemble an impact report.\n\n```go\ntype Request struct {\n\t// Diff targets\n\tRepo    string\n\tBaseRef string\n\tBaseSHA string\n\tRepoA   string\n\tRepoB   string\n\tPaths   []string\n\n\t// Cluster mode: map of cluster name → list of paths.\n\t// Derived from the \"clusters\" input and from prefixed \"paths\" entries.\n\tClusterPaths map[string][]string\n\n\t// Render options\n\tRecursive           bool\n\tRenderHelm          bool\n\tResolveGit          bool\n\tSort                bool\n\tExcludeCRDs         bool\n\tSOPSDecrypt         bool\n\tHelmRelease         string\n\tConfigFile          string\n\tFilterFile          string\n\tFilterYAML          string\n\tRegistryConfig      string\n\tRepositoryConfig    string\n\tRepositoryCache     string\n\tCrossplane          bool\n\tCrossplaneEngine    string\n\tCrossplaneFunctions []string\n\tFluxPlugin          string\n\tCrossplanePlugin    string\n\n\t// Export\n\tExportDir         string\n\tExportChangedOnly bool\n\n\t// Reporting\n\tWriteSummary                   bool\n\tComment                        bool\n\tCommentMode                    string // changes, always, failure\n\tMaxInlineDiffBytes             int\n\tDiffPreviewLines               int\n\tHTMLReport                     bool\n\tHTMLReportName                 string\n\tHTMLReportRetentionDays        int\n\tHTMLReportMaxResourceDiffBytes int\n\tAIAssessment                   string\n\tAIProvider                     string\n\tAIModel                        string\n\tAIFailOnError                  string\n\n\t// Policy\n\tFailOnWarning bool\n\tFailOnError   bool\n}\n```\nRequest captures normalized inputs for the GitHub Action mode.\n\n```go\nfunc ParseRequestFromEnv() (*Request, error)\n```\nParseRequestFromEnv builds a Request from GitHub Actions inputs (passed as env vars).\n\n```go\nfunc (r *Request) ConfigRoot() string\n```\nConfigRoot returns the directory to search for repository configuration.\n\n```go\nfunc (r *Request) DiffLeft() string\n```\nDiffLeft returns the base/left path or ref for diffing.\n\n```go\nfunc (r *Request) DiffRight() string\n```\nDiffRight returns the target/right path or ref for diffing.\n\n```go\nfunc (r *Request) HasConfig() bool\n```\nHasConfig returns true if an explicit config file or auto-discoverable config should be used.\n\n```go\nfunc (r *Request) IsLegacy() bool\n```\nIsLegacy returns true when the legacy two-repo mode is used.\n\n```go\nfunc (r *Request) ShouldComment(report *ActionReport) bool\n```\nShouldComment returns true if a comment should be posted/updated for this report.\n\n```go\nfunc (r *Request) ShouldDeleteComment(report *ActionReport) bool\n```\nShouldDeleteComment returns true when an existing comment should be deleted (no longer relevant).\n\n```go\nfunc (r *Request) ShouldFail(report *ActionReport) bool\n```\nShouldFail returns true if the request says we should fail for the current report state.\n\n","path":"github.com/tobiash/gitops-preview-toolkit/pkg/githubaction","name":"githubaction","synopsis":"","isRedistributable":true}
