Skip to content

Commit

Permalink
chore: Add missing label to issue for branch creation
Browse files Browse the repository at this point in the history
  • Loading branch information
ttizze committed Jul 27, 2024
1 parent 94d0a84 commit d1ffa37
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 201 deletions.
47 changes: 0 additions & 47 deletions .github/issue-type-config.json

This file was deleted.

116 changes: 64 additions & 52 deletions .github/labels.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,64 @@
[
{
"name": "bug",
"color": "d73a4a",
"description": "Something isn't working"
},
{
"name": "feature",
"color": "0075ca",
"description": "New feature or request"
},
{
"name": "documentation",
"color": "0A0A0A",
"description": "Improvements or additions to documentation"
},
{
"name": "chore",
"color": "cfd3d7",
"description": "Maintenance tasks"
},
{
"name": "refactor",
"color": "a2eeef",
"description": "Refactoring"
},
{
"name": "dependencies",
"color": "0366d6",
"description": "Pull requests that update a dependency file"
},
{
"name": "enhancement",
"color": "a2eeef",
"description": "Enhancement proposal"
},
{
"name": "triage",
"color": "d4c5f9",
"description": "This issue needs to be triaged"
},
{
"name": "wontfix",
"color": "ffffff",
"description": "This will not be worked on"
},
{
"name": "nice to have",
"color": "fef2c0",
"description": "Low priority enhancement that would be nice to have"
}
]
{
"labels": [
{
"name": "bug",
"description": "Something isn't working as expected",
"color": "d73a4a"
},
{
"name": "feature",
"description": "New feature implementation",
"color": "0e8a16"
},
{
"name": "question",
"description": "Further information is requested",
"color": "d876e3"
},
{
"name": "enhancement",
"description": "Improvement to existing features",
"color": "a2eeef"
},
{
"name": "good first issue",
"description": "Good for newcomers",
"color": "7057ff"
},
{
"name": "help wanted",
"description": "Extra attention is needed",
"color": "008672"
},
{
"name": "duplicate",
"description": "This issue already exists",
"color": "cfd3d7"
},
{
"name": "wontfix",
"description": "This will not be worked on",
"color": "ffffff"
},
{
"name": "invalid",
"description": "This doesn't seem right",
"color": "e4e669"
},
{
"name": "documentation",
"description": "Improvements or additions to documentation",
"color": "0075ca"
},
{
"name": "refactor",
"description": "Code refactoring",
"color": "f6a2ff"
},
{
"name": "chore",
"description": "General maintenance tasks",
"color": "f6a2ff"
}
]
}
67 changes: 67 additions & 0 deletions .github/workflows/auto-comment-on -unlabeled-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Auto Comment on Unlabeled Issue

on:
issues:
types: [opened, edited]
workflow_dispatch:
inputs:
issue_number:
description: "Issue number to process"
required: true
type: number

jobs:
process_issue:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check issue labels
id: check_labels
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
ISSUE_NUMBER=${{ github.event.inputs.issue_number }}
else
ISSUE_NUMBER="${{ github.event.issue.number }}"
fi
echo "issue_number=$ISSUE_NUMBER" >> $GITHUB_OUTPUT
ISSUE_DATA=$(gh issue view $ISSUE_NUMBER --json number,title,labels)
ISSUE_TITLE=$(echo "$ISSUE_DATA" | jq -r '.title')
EXISTING_LABELS=$(echo "$ISSUE_DATA" | jq -r '.labels[].name')
echo "Debug: Current labels: EXISTING_LABELS=$EXISTING_LABELS"
# Define the labels we want users to add
USER_LABELS="bug feature enhancement question"
# Check if any of the user labels already exist
if echo "$EXISTING_LABELS" | grep -qE "(${USER_LABELS// /|})" ; then
echo "skip=true" >> $GITHUB_OUTPUT
echo "Skipping comment as relevant labels already exist."
else
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Add comment if no labels
if: steps.check_labels.outputs.skip == 'false'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ steps.check_labels.outputs.issue_number }}
run: |
COMMENT="Thank you for opening this issue. To help us categorize and prioritize it better, please consider adding one of the following labels:
- bug: Something isn't working as expected
- feature: New feature implementation
- enhancement: Improvement to existing features
- question: Further information is requested
Adding a label will help our team quickly understand the nature of the issue and address it more efficiently. Thank you for your cooperation!"
if gh issue comment $ISSUE_NUMBER --body "$COMMENT"; then
echo "Successfully added comment to issue #$ISSUE_NUMBER"
else
echo "Failed to add comment to issue #$ISSUE_NUMBER"
exit 1
fi
89 changes: 0 additions & 89 deletions .github/workflows/auto-label-issue.yml

This file was deleted.

Loading

0 comments on commit d1ffa37

Please sign in to comment.