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

ga label #102

Merged
merged 1 commit into from
Jul 27, 2024
Merged
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
50 changes: 25 additions & 25 deletions .github/labels.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
[
{
"name": "issue or PR: bug",
"name": "bug",
"color": "d73a4a",
"description": "Something isn't working as expected"
},
{
"name": "issue or PR: feature",
"name": "feature",
"color": "0052cc",
"description": "New feature implementation"
},
{
"name": "issue or PR: enhancement",
"name": "enhancement",
"color": "a2eeef",
"description": "Improvement to existing features"
},
{
"name": "issue: question",
"name": "question",
"color": "d876e3",
"description": "Further information is requested"
},
Comment on lines +18 to 21

Choose a reason for hiding this comment

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

Image description CodeRabbit

questionラベルは削除されるべきですが、ここではまだ存在しています。.github/workflows/create-branch-on-issue-assign.ymlの変更と矛盾しています。

-        "name": "question",
-        "color": "d876e3",
-        "description": "Further information is requested"

{
"name": "status: good first issue",
"name": "documentation",
"color": "0075ca",
"description": "Improvements or additions to documentation"
},
{
"name": "refactor",
"color": "fbca04",
"description": "Code refactoring"
},
{
"name": "chore",
"color": "bfdadc",
"description": "General maintenance tasks"
},
{
"name": "good first issue",
"color": "7057ff",
"description": "Good for newcomers"
},
{
"name": "status: help wanted",
"name": "help wanted",
"color": "008672",
"description": "Extra attention is needed"
},
{
"name": "close: duplicate",
"name": "duplicate",
"color": "cfd3d7",
"description": "This issue already exists"
"description": "This issue or pull request already exists"
},
{
"name": "close: wontfix",
"name": "wontfix",
"color": "ffffff",
"description": "This will not be worked on"
},
{
"name": "close: invalid",
"name": "invalid",
"color": "e4e669",
"description": "This doesn't seem right"
},
{
"name": "PR: documentation",
"color": "0075ca",
"description": "Improvements or additions to documentation"
},
{
"name": "PR: refactor",
"color": "fbca04",
"description": "Code refactoring"
},
{
"name": "PR: chore",
"color": "bfdadc",
"description": "General maintenance tasks"
}
]
10 changes: 5 additions & 5 deletions .github/workflows/auto-comment-on-unlabeled-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
echo "Debug: Current labels: EXISTING_LABELS=$EXISTING_LABELS"

# Define the labels we want users to add
USER_LABELS="issue or PR: bug|issue or PR: feature|issue or PR: enhancement|issue: question"
USER_LABELS="bug|feature|enhancement|question"

# Check if any of the user labels already exist
if echo "$EXISTING_LABELS" | grep -qE "(${USER_LABELS})" ; then
Expand All @@ -52,10 +52,10 @@ jobs:
run: |
COMMENT="Thank you for opening this issue. To help us categorize and prioritize it better, please consider adding one of the following labels:

- issue or PR: bug: Something isn't working as expected
- issue or PR: feature: New feature implementation
- issue or PR: enhancement: Improvement to existing features
- issue: question: Further information is requested
- 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!"

Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/create-branch-on-issue-assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
exit 1
fi

VALID_LABELS="bug feature enhancement question documentation refactor chore"
BRANCH_LABEL=$(echo "$LABELS" | tr ' ' '\n' | grep -m1 -w "$VALID_LABELS")
VALID_LABELS="bug|feature|enhancement|documentation|refactor|chore"
BRANCH_LABEL=$(echo "$LABELS" | tr ' ' '\n' | grep -m1 -E "$VALID_LABELS")
Comment on lines +47 to +48

Choose a reason for hiding this comment

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

Image description CodeRabbit

grepコマンドの正規表現を使用するために、-Eオプションが追加されていますが、trコマンドでスペースを改行に変換しているため、grep -m1 -wのままで問題ありません。変更は不要です。

-           VALID_LABELS="bug|feature|enhancement|documentation|refactor|chore"
-           BRANCH_LABEL=$(echo "$LABELS" | tr ' ' '\n' | grep -m1 -E "$VALID_LABELS")
+           VALID_LABELS="bug feature enhancement documentation refactor chore"
+           BRANCH_LABEL=$(echo "$LABELS" | tr ' ' '\n' | grep -m1 -w "$VALID_LABELS")


if [ -z "$BRANCH_LABEL" ]; then
echo "no_valid_label=true" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -77,11 +77,10 @@ jobs:
- bug: Something isn't working as expected
- feature: New feature implementation
- enhancement: Improvement to existing features
- question: Further information is requested
- documentation: Improvements or additions to documentation
- refactor: Code refactoring
- chore: General maintenance tasks

Adding an appropriate label will help our team quickly understand the nature of the issue and create the correct branch. Once you've added a label, we'll automatically create a branch for this issue. Thank you for your cooperation!"

gh issue comment $ISSUE_NUMBER --body "$COMMENT"
gh issue comment $ISSUE_NUMBER --body "$COMMENT"
Loading