# yaml-language-server: $schema=Secretfile.schema.json
version: '1.0'

variables:
  github_org: zloeber
  github_repo: SecretZero

providers:
  github:
    kind: github
    auth:
      kind: token
      config:
        token: ${GITHUB_TOKEN}

secrets:
  # ── Release token with write access to contents & PRs ──────────────
  # - name: release_token
  #   kind: github_pat
  #   config:
  #     provider: github
  #     permissions:
  #       contents: write
  #       pull_requests: write
  #       issues: write
  #       workflows: write
  #     repositories:
  #       - ${github_repo}
  #     token_name: release-bot
  #   targets:
  #     - provider: github
  #       kind: github_secret
  #       config:
  #         owner: ${github_org}
  #         repo: ${github_repo}
  #         secret_name: RELEASE_TOKEN
  # Cloudflare Pages API token for deployment of documentation site to docs.secret0.com
- name: cloudflare_pages_api_token
  kind: static
  config:
    default: ${CLOUDFLARE_PAGES_API_TOKEN}
  targets:
  - provider: github
    kind: github_secret
    config:
      owner: ${github_org}
      repo: ${github_repo}
      secret_name: CLOUDFLARE_PAGES_API_TOKEN
          #create_environment: true
  # # TestPyPI API token for test releases
  # - name: testpypi_token
  #   kind: static
  #   config:
  #     default: ${TESTPYPI_TOKEN}
  #   targets:
  #     - provider: github
  #       kind: github_secret
  #       config:
  #         owner: ${github_org}
  #         repo: ${github_repo}
  #         secret_name: PYPI_API_TOKEN
  #         environment: testpypi
  #         #create_environment: true

  # # Production PyPI API token for official releases
  # - name: production_token
  #   kind: static
  #   config:
  #     default: ${PRODUCTION_TOKEN}
  #   targets:
  #     - provider: github
  #       kind: github_secret
  #       config:
  #         owner: ${github_org}
  #         repo: ${github_repo}
  #         secret_name: PYPI_API_TOKEN
  #         environment: production
  #         #create_environment: true

metadata:
  project: SecretZero
  owner: zloeber
  description: PyPI API tokens for SecretZero package publishing
  environments:
  - testpypi
  - production
