Skip to content

Nothing the agent does in GitHub Actions shows up in the usage dashboard #17

Closed as not planned

Description

@iamrraj

What happened

I set up the PR review workflow and it works — reviews get posted, and each one used to print its token count and cost at the bottom of the comment.

But the usage dashboard shows none of it. It only ever shows the runs I do from my own machine. Every review the Action has done is missing: no runs, no tokens, no spend, nothing in "By surface".

What I expected

CI runs are the ones I actually care about costing. The local ones are me experimenting. If anything it is backwards right now.

What I have worked out

I think the container has nowhere to write — I set FORGE_USAGE_DB in the workflow and it changed nothing, which would make sense if the file disappears with the container at the end of the job.

What I would like

Some way for a run in Actions to reach the dashboard. I do not mind if it needs a URL and a token; I would rather that than open a pull request to read a number off a comment. If there is a simpler way that works without me hosting anything, that would be better still.

Activity

  1. iamrraj commented on Aug 4, 2026

    @iamrraj
    ContributorAuthor

    /help how do I record CI runs into the usage dashboard?

  2. github-actions commented on Aug 4, 2026

    @github-actions

    You're trying to centralize usage data from your GitHub Actions runs into a single dashboard, rather than having each action run store its data in a temporary local file. The FORGE_USAGE_DB environment variable is for specifying a local SQLite database file, which, as you've observed, isn't suitable for ephemeral CI environments.

    Here's how to set up a centralized usage dashboard and have your GitHub Actions report to it:

    1. Set up the Usage Dashboard Server:
      You need to run the ShipIT Forge usage dashboard as a server that your GitHub Actions can report to. This server will store the usage data in a persistent SQLite database.

      • Action: Choose a hosting provider (e.g., Cloud Run, Render) and deploy the Forge usage server. The deploy/ directory in this repository has guides. For example, for Cloud Run, you would follow deploy/cloudrun.sh and deploy/DEPLOY.md.
      • Command (example for local testing):
        FORGE_USAGE_DB=./usage-dashboard.db FORGE_DASHBOARD_TOKEN=your_secret_token npm run serve-usage
        Replace your_secret_token with a strong, secret token. This token will be used to authenticate incoming usage reports.
      • Check: The server should be running and accessible at a public URL (e.g., https://your-dashboard-url.com). Make sure FORGE_USAGE_DB is set to a persistent location on your server, not a temporary one.
    2. Configure GitHub Action to Report to the Dashboard:
      Once your usage dashboard server is running, configure your GitHub Action to send its usage data to this server.

      • Action: In your GitHub Actions workflow file (e.g., .github/workflows/ci.yml), add the following environment variables to the step that runs ShipIT Forge:
        env:
          FORGE_USAGE_URL: https://your-dashboard-url.com/api/usage
          FORGE_DASHBOARD_TOKEN: ${{ secrets.FORGE_DASHBOARD_TOKEN }}
        Replace https://your-dashboard-url.com/api/usage with the actual URL of your deployed dashboard's usage API endpoint.
      • Action: Add FORGE_DASHBOARD_TOKEN to your GitHub repository secrets with the same secret token you set up for your dashboard server.
    3. Verify it worked:

      • Trigger a GitHub Actions workflow run.
      • After the run completes, navigate to your deployed usage dashboard URL. You should see new entries reflecting the usage from your CI runs. The "By surface" breakdown should now include data from your GitHub Actions.
    4. What to watch out for:

      • Security of FORGE_DASHBOARD_TOKEN: Treat FORGE_DASHBOARD_TOKEN as a sensitive secret. Do not hardcode it in your workflow files; always use GitHub Secrets.
      • Server Accessibility: Ensure your usage dashboard server is publicly accessible from GitHub's IP ranges if you are hosting it behind a firewall.
      • Persistent Storage: Double-check that the FORGE_USAGE_DB on your dashboard server is configured to use persistent storage (e.g., a mounted volume on Cloud Run, or a persistent disk) so that data is not lost if the server restarts.
    5. Where to read more:

      • src/usage/serve.ts: The code for the usage dashboard server.
      • src/usage/api.ts: Defines the API for reporting usage.
      • deploy/: Deployment guides for various platforms.
      • src/action.ts: The main GitHub Action entry point, which would consume these environment variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions