Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add auto-labeler based off of code changes #1320

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Labeler
on: [pull_request_target]

jobs:
label:

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write

steps:
- uses: actions/labeler@v4
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the permissions are set correctly to avoid any security issues, especially with 'pull-requests: write'.

with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
72 changes: 72 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# .github/labeler.yml

# Label PRs that modify documentation files
Documentation:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defined clear labeling rules for different directories, which will help maintain organization in our pull requests.

- changed-files:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding comments to clarify the purpose and usage of each label configuration for future maintainability.

- 'docs/**'

# Label PRs with 'feature' if the head branch name starts with 'feature'
Feature:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the regex for head-branch accurately matches your desired feature branches. Consider expanding this to include other branch naming conventions if necessary.

- head-branch: ['^feature']

# Label PRs that modify files in the agent directory
Agent:
- changed-files:
- 'agent/**'

# Label PRs that modify files in the .github directory
GitHub:
- changed-files:
- '.github/**'

# Label PRs that modify files in the .turbo directory
Turbo:
- changed-files:
- '.turbo/**'

# Label PRs that modify files in the characters directory
Characters:
- changed-files:
- 'characters/**'

# Label PRs that modify files in the client directory
Client:
- changed-files:
- 'client/**'
- changed-files:
- 'packages/client-*/**'

# Label PRs that modify files in the packages directory
Packages:
- changed-files:
- 'packages/**'

# Label PRs that modify files in the scripts directory
Scripts:
- changed-files:
- 'scripts/**'

# Label PRs that modify files in the src directory
Source:
- changed-files:
- 'src/**'

# Label PRs that modify files in the tests directory
Tests:
- changed-files:
- 'tests/**'

# Label PRs that modify files in the packages/adapter* directories
Adapter:
- changed-files:
- 'packages/adapter*/**'

# Label PRs that modify files in the packages/core directory
Core:
- changed-files:
- 'packages/core/**'

# Label PRs that modify files in the packages/plugin* directories
Plugin:
- changed-files:
- 'packages/plugin*/**'
Loading