name: github
description: GitHub Issues + GitHub Projects v2 + Markdown docs + GitHub Actions + Pull Requests

config:
  owner: github.owner
  repo: github.repo
  base_branch: github.base_branch
  auth:
    primary: github_app
    token_env_fallback: GITHUB_TOKEN
  project:
    kind: projects_v2
    owner_type: organization_or_user
    owner: github.project.owner
    number_or_id: github.project.number_or_id
    field_mapping: github.project.field_mapping
  webhook_secret_env: GITHUB_WEBHOOK_SECRET
  webhook:
    receiver: optional_http_raw_body
    default_path: /github/webhook
    port_env: SDD_GITHUB_WEBHOOK_PORT

artifacts:
  idea:
    content_owner: github_issue
    state_owner: github_issue
    canonical_id: GH-issue_number
  prd:
    content_owner: markdown
    state_owner: github_issue
    canonical_id: docs_path_or_issue_comment_url
  techspec:
    content_owner: markdown
    state_owner: github_issue
    canonical_id: docs_path_or_issue_comment_url
  tasks:
    content_owner: github_issues_or_sub_issues
    state_owner: github_issues_or_project_items
    canonical_id: GH-issue_number
  refinement:
    content_owner: markdown
    state_owner: github_issue
    canonical_id: docs_path
  execution:
    content_owner: git_branch
    state_owner: pull_request
    canonical_id: branch
  review:
    content_owner: pull_request
    state_owner: pull_request
    canonical_id: pull_request_number
  memory:
    content_owner: markdown
    state_owner: traceability_map
    canonical_id: docs_path

events:
  idea_created: issues.opened
  prd_approved: issue_labeled_or_comment_command
  techspec_approved: issue_labeled_or_comment_command
  refinement_approved: issue_labeled_or_comment_command
  pr_opened: pull_request.opened
  ci_green: check_suite.completed_or_workflow_run.completed
  review_approved: pull_request_review.submitted
  deploy_done: deployment_status.success
  project_updated: projects_v2_item.public_preview

fallbacks:
  approval: issue_comment_with_explicit_decision
  polling: scheduled_task_for_check_runs
  docs: repo_markdown
  projects_v2_webhook: polling_or_manual_status_refresh

traceability:
  local_source: docs/<slug>/traceability-map.yaml
  external_links:
    github:
      kinds:
        - issue
        - project_item
        - pull_request
        - action_run
