diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000..a0a99f0f --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,67 @@ +# Configuration for GitHub Labeler Action +# https://github.com/actions/labeler + +# Documentation changes +T-documentation: + - changed-files: + - any-glob-to-any-file: ['**/*.md', 'docs/**/*', '**/*.rst'] + +# Core library changes +T-core: + - changed-files: + - any-glob-to-any-file: ['crates/rmcp/src/**/*'] + +# Macro changes +T-macros: + - changed-files: + - any-glob-to-any-file: ['crates/rmcp-macros/**/*'] + +# Example changes +T-examples: + - changed-files: + - any-glob-to-any-file: ['examples/**/*'] + +# CI/CD changes +T-CI: + - changed-files: + - any-glob-to-any-file: ['.github/**/*', '**/*.yml', '**/*.yaml', '**/Dockerfile*'] + +# Dependencies +T-dependencies: + - changed-files: + - any-glob-to-any-file: ['**/Cargo.toml', '**/Cargo.lock', '**/package.json', '**/package-lock.json', '**/requirements.txt', '**/pyproject.toml'] + +# Tests +T-test: + - changed-files: + - any-glob-to-any-file: ['**/tests/**/*', '**/*test*.rs', '**/benches/**/*'] + +# Transport layer changes +T-transport: + - changed-files: + - any-glob-to-any-file: ['crates/rmcp/src/transport/**/*'] + +# Service layer changes +T-service: + - changed-files: + - any-glob-to-any-file: ['crates/rmcp/src/service/**/*'] + +# Handler changes +T-handler: + - changed-files: + - any-glob-to-any-file: ['crates/rmcp/src/handler/**/*'] + +# Model changes +T-model: + - changed-files: + - any-glob-to-any-file: ['crates/rmcp/src/model/**/*'] + +# Configuration files +T-config: + - changed-files: + - any-glob-to-any-file: ['**/*.toml', '**/*.json', '**/*.yaml', '**/*.yml', '**/*.env*'] + +# Security related files +T-security: + - changed-files: + - any-glob-to-any-file: ['**/security.md', '**/SECURITY.md', '**/audit.toml'] \ No newline at end of file diff --git a/.github/workflows/auto-label-pr.yml b/.github/workflows/auto-label-pr.yml new file mode 100644 index 00000000..860068c6 --- /dev/null +++ b/.github/workflows/auto-label-pr.yml @@ -0,0 +1,27 @@ +name: Auto Label PR +on: + # Runs workflow when activity on a PR in the workflow's repository occurs. + pull_request_target: + +jobs: + auto-label: + permissions: + contents: read + pull-requests: write + + name: Assign labels + runs-on: ubuntu-latest + timeout-minutes: 5 + + # Required by gh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_URL: ${{ github.event.pull_request.html_url }} + + steps: + - uses: actions/labeler@v5 + with: + # Auto-include paths starting with dot (e.g. .github) + dot: true + # Remove labels when matching files are reverted or no longer changed by the PR + sync-labels: true \ No newline at end of file