Skip to content

ci: add aireceipts pr-check (notice-only cost receipt)#33

Open
anandgupta42 wants to merge 4 commits into
mainfrom
dogfood/aireceipts-pr-check
Open

ci: add aireceipts pr-check (notice-only cost receipt)#33
anandgupta42 wants to merge 4 commits into
mainfrom
dogfood/aireceipts-pr-check

Conversation

@anandgupta42

@anandgupta42 anandgupta42 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Adds a notice-only aireceipts cost-receipt check (pr-check) — one self-contained workflow, no external reusable workflow, no org Actions-policy change. Never fails a build; posts an aireceipts cost receipt only once a branch carries an aireceipts receipt ref, otherwise a quiet no-op. Coexists with any existing check; remove anytime by deleting the file. Part of an org-wide aireceipts dogfood.


Note

Low Risk
Adds an isolated CI workflow with read-only repo access plus PR comment permissions; it cannot fail the build and does not touch application code.

Overview
Adds a new GitHub Actions workflow .github/workflows/aireceipts.yml that runs on every pull request.

On each PR it runs npx -y aireceipts-cli@latest pr-check with GH_TOKEN and pull-requests: write so the CLI can post a cost receipt when the branch has an aireceipts receipt ref; otherwise it no-ops. The step uses continue-on-error: true, so the check is notice-only and does not fail the workflow. Concurrency cancels in-progress runs per ref.

Reviewed by Cursor Bugbot for commit de9ba4f. Bugbot is set up for automated code reviews on this repo. Configure here.

check:
runs-on: ubuntu-latest
steps:
- run: npx -y aireceipts-cli@latest pr-check

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Unpinned @latest runs third-party code with pull-requests: write on every PR

npx -y aireceipts-cli@latest resolves to whatever version is published at run time. Since this job grants pull-requests: write and passes GH_TOKEN (github.token), a compromised or broken publish of aireceipts-cli executes automatically against every PR and can post/modify PR comments. Pin to a specific version (and ideally verify integrity) instead of @latest.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

check:
runs-on: ubuntu-latest
steps:
- run: npx -y aireceipts-cli@latest pr-check

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: "Never fails a build" guarantee isn't enforced here

The PR describes this as notice-only / "Never fails a build", but a transient npx install failure, registry error, or non-zero CLI exit will turn this check red. Add continue-on-error: true to the step so a notice-only check can never fail the job.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
.github/workflows/aireceipts.yml 13 Unpinned @latest runs third-party code with pull-requests: write on every PR
Files Reviewed (1 file)
  • .github/workflows/aireceipts.yml - 1 issue

Fix these issues in Kilo Cloud

Previous Review Summaries (2 snapshots, latest commit 232b3a6)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 232b3a6)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
.github/workflows/aireceipts.yml 10 "Never fails a build" guarantee isn't enforced — add continue-on-error: true to the step
Files Reviewed (1 file)
  • .github/workflows/aireceipts.yml - 1 issue

Fix these issues in Kilo Cloud

Previous review (commit d4e7701)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
.github/workflows/aireceipts.yml 10 Unpinned aireceipts-cli@latest runs third-party code with pull-requests: write on every PR (supply-chain risk)

SUGGESTION

File Line Issue
.github/workflows/aireceipts.yml 10 "Never fails a build" guarantee isn't enforced — add continue-on-error: true to the step
Files Reviewed (1 file)
  • .github/workflows/aireceipts.yml - 2 issues

Fix these issues in Kilo Cloud


Reviewed by glm-5.2 · Input: 18K · Output: 7.5K · Cached: 143.6K

Comment thread .github/workflows/aireceipts.yml Outdated
check:
runs-on: ubuntu-latest
steps:
- run: npx -y aireceipts-cli@0.5.0 pr-check

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: "Never fails a build" guarantee isn't enforced here

The PR describes this check as notice-only / "Never fails a build", but a transient npx install failure, registry error, or non-zero CLI exit will mark this check red and can block PR merges. Add continue-on-error: true to the step so a notice-only check can never fail the job.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@anandgupta42

Copy link
Copy Markdown
Contributor Author

Hi @andreahlert — could one of you give this a quick review + approve when you get a moment? 🙏

It's a notice-only aireceipts cost-receipt check (a single .github/workflows/aireceipts.yml, pull-requests: write, never fails a build — it posts a cost receipt only once a branch carries an aireceipts ref, otherwise a quiet no-op). Part of an org-wide aireceipts dogfood; it's blocked only on the required 1 approving review. Remove anytime by deleting the file. Thanks!

@anandgupta42

Copy link
Copy Markdown
Contributor Author

Hi @ppradnesh 👋 — friendly nudge as the top contributor here.

This is a lightweight aireceipts dogfood PR (part of an org-wide rollout). It adds a notice-only pr-check GitHub Action that posts a deterministic, cited cost receipt comment on a PR only when a receipt ref is present — and does nothing otherwise. It touches no existing workflow, adds no required check, and never blocks a merge.

CI is green. Could you give it a quick review + merge when you have a moment? (It needs one approving review from someone with write access — admin bypass is off here.) Happy to answer any questions. Thanks! 🙏

@anandgupta42

Copy link
Copy Markdown
Contributor Author

Thanks for the automated review — addressed:

  • continue-on-error: true added on the step. This check is notice-only and now stays green even if npx/aireceipts-cli exits non-zero (npm/network hiccup, a broken release, or a CLI exception) — honoring the "never fails a build" intent.
  • concurrency added (cancel-in-progress: true) so rapid pushes can't race to post duplicate receipts or burn extra runner minutes.

Intentional, left as-is:

  • @latest (not pinned): deliberate per aireceipts SPEC-0064 — the check auto-adopts each vetted release (the latest tag is force-moved only by the package's own publish workflow). The surface is bounded — it's a first-party package, and with continue-on-error the step can never block a build. Keeping auto-adoption is a maintainer decision.
  • Fork PRs: pull_request grants a read-only token on forks, so the receipt comment is simply skipped there (fork PRs stay notice-only, by design). We deliberately do not use pull_request_target, which would run untrusted fork code with a write token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant