Skip to content
Merged
Changes from 1 commit
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
37 changes: 35 additions & 2 deletions .github/workflows/auto-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ name: Auto Label
on:
pull_request:
types: [opened, synchronize, edited, reopened]
issues:
types: [opened]

permissions:
contents: read
pull-requests: write
issues: write
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

jobs:
label-by-files:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
Comment thread
kimminna marked this conversation as resolved.
Expand All @@ -18,7 +22,7 @@ jobs:
sync-labels: false

label-by-prefix:
if: github.event.action != 'synchronize'
if: github.event_name == 'pull_request' && github.event.action != 'synchronize'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
Expand Down Expand Up @@ -73,7 +77,7 @@ jobs:
});

label-by-author:
if: github.event.action == 'opened' || github.event.action == 'reopened'
if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
Expand All @@ -100,3 +104,32 @@ jobs:
issue_number: context.payload.pull_request.number,
labels: [label],
});

issue-label-by-author:
if: github.event_name == 'issues'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
Comment thread
kimminna marked this conversation as resolved.
with:
script: |
const authorMap = {
'kimminna': '♦️ 민아',
'ehye1': '♥️ 혜원',
'jjangminii': '♠️ 정민',
'yumin-kim2': '♣️ 유민',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

엇 label-issues authorMap에 저만 있는 것 같아요..! 나머지 분들 매핑이 빠진 것 같은데 확인 부탁드려요 🙏

};

const author = context.payload.issue.user.login;
const label = authorMap[author];

if (!label) {
console.log(`"${author}"에 대한 라벨 매핑이 없습니다.`);
return;
}

await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
labels: [label],
});
Loading