Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

GitHub Actions Integration

When running in GitHub Actions, the plugin automatically captures environment variables and includes them in every event record.

Captured Variables

GitHub Env VarMetric FieldDescription
GITHUB_RUN_IDgh_run_idUnique ID for the workflow run
GITHUB_SHAgh_shaCommit SHA that triggered the run
GITHUB_REF_NAMEgh_ref_nameBranch or tag name
GITHUB_WORKFLOWgh_workflowWorkflow name
GITHUB_JOBgh_jobJob ID
GITHUB_ACTORgh_actorUser or app that triggered the run
GITHUB_REPOSITORYgh_repositoryOwner/repo (e.g. org/repo)
GITHUB_RUN_ATTEMPTgh_run_attemptRetry attempt number

If a variable is not set (e.g. running locally), the corresponding field is an empty string.

Example Workflow

name: Tests
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"

      - run: pip install pytest-resource-mon

      - run: pytest
        env:
          TINYBIRD_WRITE_TOKEN: ${{ secrets.TINYBIRD_WRITE_TOKEN }}

No extra configuration is needed — the GITHUB_* variables are set automatically by the Actions runner.