cost

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package cost provides runner cost estimation for GitHub Actions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BillableMinutes

func BillableMinutes(d time.Duration) float64

BillableMinutes returns the billable minutes for a job duration. Uses the default model.

func IsSelfHosted

func IsSelfHosted(labels []string) bool

IsSelfHosted reports whether the labels indicate a self-hosted runner.

func LookupMultiplier

func LookupMultiplier(labels []string) float64

LookupMultiplier returns the billing multiplier for a set of runner labels. Uses the default model.

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model holds runner cost configuration. Use DefaultModel() for standard GitHub rates.

func DefaultModel

func DefaultModel() Model

DefaultModel returns a Model with GitHub's published billing multipliers.

func (Model) BillableMinutes

func (Model) BillableMinutes(d time.Duration) float64

BillableMinutes returns the billable minutes for a job duration. GitHub rounds each job's duration up to the nearest whole minute.

func (Model) IsSelfHosted

func (Model) IsSelfHosted(labels []string) bool

IsSelfHosted reports whether the labels indicate a self-hosted runner.

func (Model) LookupMultiplier

func (m Model) LookupMultiplier(labels []string) float64

LookupMultiplier returns the billing multiplier for a set of runner labels. Self-hosted runners return 0 (free on GitHub billing). Checks each label against the known multiplier table, then tries larger-runner pattern matching. Returns 1.0 (Linux default) if no match.

Jump to

Keyboard shortcuts

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