GitHub Action
Emoji Issue Classifier
Emoji Issue Classifier
Emoji Issue Classifier
Automatically classifies GitHub issues and labels them with emojis
Installation
Copy and paste the following snippet into your .yml file.
- name: Emoji Issue Classifier
uses: plopcas/emoji-issue-classifier@v1.1.0
Emoji Issue Classifier
The Emoji Issue Classifier is a GitHub Action that automatically classifies issues by adding relevant emoji labels. It performs sentiment analysis, keyword matching, and machine learning-based classification to add relevant emoji labels to the issues.
Usage
- Create a
.github/workflows/emoji-classifier.ymlfile in your repository. - Add the following workflow configuration to the file:
# .github/workflows/issue-classifier.yml
name: 'Use Emoji Issue Classifier Action'
on:
issues:
types: [opened, edited]
jobs:
classify:
runs-on: ubuntu-latest
steps:
- name: Use Emoji Classifier
uses: plopcas/emoji-issue-classifier@v1.1.0
env:
GITHUB_TOKEN: ${{ secrets.PAT }}- Configure the necessary environment variables:
GITHUB_TOKEN: GitHub token with repository access.
- Customize the behavior of the Emoji Issue Classifier by modifying the Python script (
main.py) based on your requirements. - Run the Emoji Issue Classifier by executing
python main.pyin the repository directory.
Test
In order to test the classifier you can:
- Create a
test.jsonfile with the following content:
{
"issue": {
"number": 1
}
}
- Create a
test.shfile with the following content:
#!/bin/bash
# test.sh
export GITHUB_TOKEN=YOUR_TOKEN
export GITHUB_REPOSITORY=YOUR_REPOSITORY
export GITHUB_EVENT_PATH=test/test.json
python classifier/main.py
- Ensure that the bash script (test.sh) has the correct permissions to be executed.
chmod +x test.sh
- Run run this bash script from the terminal with:
./test.sh
Customization
You can customize the behavior of the Emoji Issue Classifier by modifying the following components:
- Sentiment Analysis: adjust the sentiment thresholds and corresponding emojis in the
get_sentiment_emojifunction. - Keyword Matching: add or modify keywords and corresponding emojis in the
get_keyword_emojifunction. - Trained Model: train and save a new model using the provided
trainscript and replace themodel.pklfile. - Label Color: change the label color in the
add_label_to_issuefunction by modifying the hex color code.
Contributing
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
License
This project is licensed under the MIT License.