Skip to content

Portfolio Actions workflow template #74

@djdarcy

Description

@djdarcy

Portfolio Actions workflow template

Parent: Cross-repo engagement radar epic
Milestone: v0.5.0

Goal

Provide a GitHub Actions workflow that runs ghtraf portfolio collect on a schedule, storing daily snapshots to a gist for the dashboard to read.

Design

Where it runs: A single repo chosen by the user. Recommended locations:

  • The user's .github profile repo (if they have one)
  • A dedicated my-portfolio or github-dashboard repo
  • Any existing repo (e.g., github-traffic-tracker itself)

Schedule: Daily (same 3am UTC pattern as traffic-badges.yml, or user-configured)

Workflow template (portfolio-collect.yml):

name: Portfolio Collect
on:
  schedule:
    - cron: '15 3 * * *'  # 3:15 AM UTC daily (offset from traffic collection)
  workflow_dispatch:       # Manual trigger

jobs:
  collect:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with: { python-version: '3.11' }
      - run: pip install ghtraf
      - run: ghtraf portfolio collect --non-interactive
        env:
          GH_TOKEN: ${{ secrets.PORTFOLIO_PAT }}

Auth requirements

The portfolio collector needs a PAT with:

  • repo (read access to private repos, if desired)
  • read:org (enumerate org repos)

This is a broader scope than per-repo traffic collection (which uses GITHUB_TOKEN with push access). The ghtraf portfolio setup command (#SUB4) should guide users through creating this PAT.

Relationship to per-repo workflow

  • Independent: portfolio workflow runs in one repo; traffic workflow runs in each repo
  • Complementary: portfolio shows cross-repo overview; traffic shows per-repo detail
  • No conflict: different schedules, different gists, different data

Dependencies

Analysis

See 2026-03-21__17-57-11__dev-workflow-process_cross-repo-analytics-extend-vs-separate.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestportfolioCross-repo/org-level analytics and engagement tracking

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions