Skip to content

Feature: Default branch files management #8

@gjed

Description

@gjed

Summary

Auto-create and manage common repository files like CODEOWNERS, SECURITY.md, FUNDING.yml, etc.

Problem

Standard repository files must be manually created in each repository:

  • CODEOWNERS for code review routing
  • SECURITY.md for vulnerability reporting
  • FUNDING.yml for sponsorship
  • SUPPORT.md for support channels
  • LICENSE files

This leads to inconsistency and missing files across repositories.

Proposed Solution

Add default files configuration:

# In repositories.yml
repositories:
  my-repo:
    files:
      codeowners:
        entries:
          - pattern: "*"
            owners: ["@myorg/core-team"]
          - pattern: "docs/*"
            owners: ["@myorg/docs-team"]
          - pattern: "*.tf"
            owners: ["@myorg/platform-team"]
      
      security:
        contact: security@example.com
        policy_url: https://example.com/security-policy
        pgp_key: https://example.com/pgp-key.asc
        # Or provide full content:
        # content: |
        #   # Security Policy
        #   ...
      
      funding:
        github: [username]
        patreon: username
        open_collective: project
        custom: ["https://example.com/donate"]
      
      support:
        content: |
          # Support
          
          - Documentation: https://docs.example.com
          - Issues: Use GitHub issues
          - Chat: https://discord.gg/xxx
      
      license:
        type: MIT  # or Apache-2.0, GPL-3.0, etc.
        year: 2024
        holder: "My Organization"

# Organization defaults in config.yml
defaults:
  files:
    security:
      contact: security@example.com
    codeowners:
      entries:
        - pattern: "*"
          owners: ["@myorg/maintainers"]

Supported Files

File Description
CODEOWNERS Code review assignments
SECURITY.md Security policy
FUNDING.yml Sponsorship configuration
SUPPORT.md Support channels
LICENSE License file
CONTRIBUTING.md Contribution guidelines
CODE_OF_CONDUCT.md Code of conduct

Implementation

Use github_repository_file to create files in the default branch.

Tasks

  • Design files schema
  • Implement CODEOWNERS generation
  • Implement SECURITY.md generation
  • Implement FUNDING.yml generation
  • Implement SUPPORT.md generation
  • Implement LICENSE generation with templates
  • Support file inheritance from groups/defaults
  • Update documentation
  • Add organization-level defaults

Considerations

  • Handle existing files (skip, overwrite, merge)
  • File content validation
  • License template library

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions