{"_id":"@barissozudogru/gha-cost","_rev":"2-3cf4d1f516a3f43cbddf4e435189a726","name":"@barissozudogru/gha-cost","dist-tags":{"latest":"0.5.0"},"versions":{"0.4.0":{"name":"@barissozudogru/gha-cost","version":"0.4.0","keywords":["github-actions","cost","estimation","ci-cd","cli"],"author":{"name":"Baris Sozudogru"},"license":"MIT","_id":"@barissozudogru/gha-cost@0.4.0","maintainers":[{"name":"barissozudogru","email":"barissozudogru@gmail.com"}],"homepage":"https://github.com/barissozudogru/gha-cost#readme","bugs":{"url":"https://github.com/barissozudogru/gha-cost/issues"},"bin":{"gha-cost":"dist/cli.js"},"dist":{"shasum":"e8f86a59792c71133ced5e07058be4d57397d1a9","tarball":"https://registry.npmjs.org/@barissozudogru/gha-cost/-/gha-cost-0.4.0.tgz","fileCount":15,"integrity":"sha512-5JWj56wIL7L+4Dxn9tLfdfRMJh8DZs9oq5H3/E/ynLR/4wobcuz0IXXNuVRY8/bX2XNxvkoDHJwADtj0F9rrsA==","signatures":[{"sig":"MEUCIE3aKZoNaGe9OnHHlUi4jvxO2vFEDUB/9sBpOUS+AUABAiEA8/DwdNk8yQNePmCN1q4XCJyXYoXPEsh0Mmh+DLfY6aA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":59543},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"4b6327faa19238dba0e589d5d4e26cffc3cc3cba","scripts":{"test":"npm run build && node --test dist/index.test.js dist/triggers.test.js","build":"tsc","postbuild":"chmod +x dist/cli.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"barissozudogru","email":"barissozudogru@gmail.com"},"repository":{"url":"git+https://github.com/barissozudogru/gha-cost.git","type":"git"},"_npmVersion":"11.6.2","description":"Estimate GitHub Actions workflow costs before running","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^20.19.37"},"_npmOperationalInternal":{"tmp":"tmp/gha-cost_0.4.0_1787176157532_0.2790685173111096","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@barissozudogru/gha-cost","version":"0.5.0","description":"Estimate GitHub Actions workflow costs before running","type":"module","bin":{"gha-cost":"dist/cli.js"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"scripts":{"build":"tsc","postbuild":"chmod +x dist/cli.js","test":"npm run build && node --test dist/index.test.js dist/triggers.test.js","prepublishOnly":"npm run build"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"repository":{"type":"git","url":"git+https://github.com/barissozudogru/gha-cost.git"},"keywords":["github-actions","cost","estimation","ci-cd","cli"],"author":{"name":"Baris Sozudogru"},"license":"MIT","devDependencies":{"@types/node":"^20.19.37","typescript":"^5.9.3"},"gitHead":"5e20d12fe86816970fadd97394a6f6bf82416e73","_id":"@barissozudogru/gha-cost@0.5.0","bugs":{"url":"https://github.com/barissozudogru/gha-cost/issues"},"homepage":"https://github.com/barissozudogru/gha-cost#readme","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-3HCvVxmbucDQIwjw8XGPFlH5QEiRgxz8mmhKnYTW9/EaH1LYOLUdJj3hRS+m82MSlnRj6Gr1HeBiHl2sGuSMhA==","shasum":"503625ccca6b7b1763cecdba188e8bfa69b10ab7","tarball":"https://registry.npmjs.org/@barissozudogru/gha-cost/-/gha-cost-0.5.0.tgz","fileCount":15,"unpackedSize":68042,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGCaneax91bpwuky1cXZD4Xr6bbgSfpZqEYvxh/J8BQ8AiB77Lv8tWp/GGfAI83MApZaLdncbbWqj9mD+EzOdwyweQ=="}]},"_npmUser":{"name":"barissozudogru","email":"barissozudogru@gmail.com"},"directories":{},"maintainers":[{"name":"barissozudogru","email":"barissozudogru@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gha-cost_0.5.0_1787223178915_0.7220679026109855"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-19T21:49:17.356Z","modified":"2026-08-20T10:52:59.189Z","0.4.0":"2026-08-19T21:49:17.676Z","0.5.0":"2026-08-20T10:52:59.051Z"},"bugs":{"url":"https://github.com/barissozudogru/gha-cost/issues"},"author":{"name":"Baris Sozudogru"},"license":"MIT","homepage":"https://github.com/barissozudogru/gha-cost#readme","keywords":["github-actions","cost","estimation","ci-cd","cli"],"repository":{"type":"git","url":"git+https://github.com/barissozudogru/gha-cost.git"},"description":"Estimate GitHub Actions workflow costs before running","maintainers":[{"name":"barissozudogru","email":"barissozudogru@gmail.com"}],"readme":"# gha-cost\n\nKnow what your GitHub Actions workflows cost before you push.\n\n`gha-cost` parses workflow YAML files locally without executing them or making API calls. It expands matrix combinations, estimates step durations using heuristics for common actions, rounds job runtimes to whole-minute increments per GitHub billing rules, and projects costs per run, day, and month.\n\n## Usage\n\n```bash\n# Run without installing\nnpx @barissozudogru/gha-cost\n\n# Or install globally\nnpm install -g @barissozudogru/gha-cost\ngha-cost [options]\n```\n\nRun `gha-cost` from the root of a repository to scan all YAML files under `.github/workflows/`.\n\n## Options\n\n| Flag | Short | Default | Description |\n|------|-------|---------|-------------|\n| `--file <path>` | `-f` | auto-scan | Path to a specific workflow YAML file |\n| `--pushes <n>` | `-p` | `10` | Estimated triggers per day |\n| `--self-hosted-rate <rate>` | | `0` | Cost per minute (USD) for self-hosted runners |\n| `--json` | | `false` | Output results as JSON |\n| `--version` | `-v` | | Print version and exit |\n| `--help` | `-h` | | Show help |\n\nExamples:\n\n```bash\n# Scan all workflows in the current repository\ngha-cost\n\n# Estimate a specific workflow file\ngha-cost --file .github/workflows/ci.yml\n\n# Model a busier repository (50 pushes per day)\ngha-cost --pushes 50\n\n# Machine-readable output for CI gates or dashboards\ngha-cost --json | jq '.[] | .totalEstimatedCostPerMonth'\n\n# Assign a cost rate to self-hosted runners\ngha-cost --self-hosted-rate 0.004\n```\n\n## Runner Pricing\n\nRates used for estimation (USD per minute, GitHub-hosted runners):\n\n| Runner | Rate / min | Relative cost |\n|--------|-----------|---------------|\n| `ubuntu-latest` | $0.008 | 1x (baseline) |\n| `windows-latest` | $0.016 | 2x |\n| `macos-latest` | $0.080 | 10x |\n| Self-hosted | $0.000 | Configurable via `--self-hosted-rate` |\n\nRates reflect GitHub billing rules. GitHub charges in whole-minute increments per job.\n\n## Example Output\n\nGiven a workflow with lint, test matrix, build, and deploy jobs:\n\n```\n------------------------------------------------------------\nWorkflow: CI  (ci.yml)\n------------------------------------------------------------\n\n  lint  [ubuntu-latest]\n    - Checkout          actions/checkout      30s\n    - Setup Node.js     actions/setup-node    45s\n    - Install deps      npm ci                2m\n    - Lint              npm run lint          1m\n    time: 4m 15s  cost: $0.0016\n\n  test  [ubuntu-latest]  x4 matrix\n    - Checkout          actions/checkout      30s\n    - Setup Node.js     actions/setup-node    45s\n    - Install deps      npm ci                2m\n    - Run tests         npm test              5m\n    time/matrix: 8m 15s  total: 33m  cost: $0.0128\n\n  build  [ubuntu-latest]\n    - Checkout          actions/checkout      30s\n    - Setup Node.js     actions/setup-node    45s\n    - Install deps      npm ci                2m\n    - Build             npm run build         3m\n    time: 6m 15s  cost: $0.0024\n\n  deploy  [ubuntu-latest]\n    - Checkout          actions/checkout      30s\n    - Deploy            deploy to production  2m\n    time: 2m 30s  cost: $0.0008\n\n------------------------------------------------------------\nSummary\n  Total estimated time:  45m 30s\n  Cost per run:          $0.0176\n  Cost per day:          $0.176   (10 pushes/day)\n  Cost per month:        $5.28    (30 days)\n\nOptimization hints:\n  !  Job \"test\": Matrix has 4 combinations. Consider reducing matrix dimensions\n     or using fail-fast: false only when necessary.\n  !  Consider adding path filters (on.push.paths) to skip workflows when\n     unrelated files change.\n------------------------------------------------------------\n```\n\nMonthly projections assume the configured `--pushes` value daily for 30 days.\n\n## JSON Output\n\nUse `--json` to output structured data for CI scripts or dashboards:\n\n```bash\ngha-cost --json | jq '.[] | {workflow: .workflowName, monthly: .totalEstimatedCostPerMonth}'\n```\n\n```json\n[\n  {\n    \"file\": \"ci.yml\",\n    \"workflowName\": \"CI\",\n    \"jobs\": [\n      {\n        \"id\": \"test\",\n        \"name\": \"test\",\n        \"runner\": \"ubuntu\",\n        \"runnerLabel\": \"ubuntu-latest\",\n        \"steps\": [\n          {\n            \"name\": \"Checkout\",\n            \"uses\": \"actions/checkout@v4\",\n            \"estimatedSeconds\": 30\n          }\n        ],\n        \"matrix\": [{ \"key\": \"node-version\", \"values\": [\"18\", \"20\", \"22\", \"24\"] }],\n        \"matrixCombinations\": 4,\n        \"estimatedSecondsPerMatrix\": 495,\n        \"estimatedTotalSeconds\": 1980,\n        \"estimatedCostUsd\": 0.0128\n      }\n    ],\n    \"totalEstimatedSeconds\": 2730,\n    \"totalEstimatedCostPerRun\": 0.0176,\n    \"totalEstimatedCostPerDay\": 0.176,\n    \"totalEstimatedCostPerMonth\": 5.28,\n    \"hints\": [\n      \"Job \\\"test\\\": Matrix has 4 combinations. Consider reducing matrix dimensions or using fail-fast: false only when necessary.\"\n    ]\n  }\n]\n```\n\n## Exit Codes\n\n| Code | Meaning |\n|------|---------|\n| `0` | Success - at least one workflow estimated |\n| `1` | No workflow files found or all files failed to parse |\n\n## License\n\nMIT - see [LICENSE](./LICENSE).\n","readmeFilename":"README.md"}