Skip to content

[TASK-72] feat: 모달 컴포넌트 구현 #146

[TASK-72] feat: 모달 컴포넌트 구현

[TASK-72] feat: 모달 컴포넌트 구현 #146

Workflow file for this run

name: Auto Label PR
on:
pull_request:
types: [opened, edited, synchronize]
jobs:
auto-label:
runs-on: ubuntu-latest
steps:
# PR 이벤트 트리거
- name: Checkout code
uses: actions/checkout@v3
# 커밋 메시지 키워드에 따라 라벨 추가
- name: Add labels based on commit messages
uses: actions/github-script@v6
with:
script: |
const commitKeywords = {
feat: 'feature',
fix: 'bug',
chore: 'chore',
docs: 'documentation',
style: 'style',
refactor: 'refactor',
test: 'test',
perf: 'performance',
};
// context와 github는 기본적으로 제공됨
const { owner, repo } = context.repo;
const pullRequestNumber = context.payload.pull_request.number;
const { data: commits } = await github.rest.pulls.listCommits({
owner,
repo,
pull_number: pullRequestNumber,
});
const labelsToAdd = new Set();
commits.forEach(commit => {
const keyword = commit.commit.message.split(':')[0].trim();
if (commitKeywords[keyword]) {
labelsToAdd.add(commitKeywords[keyword]);
}
});
if (labelsToAdd.size > 0) {
await github.rest.issues.addLabels({
owner,
repo,
issue_number: pullRequestNumber,
labels: [...labelsToAdd],
});
console.log('Labels added:', [...labelsToAdd]);
} else {
console.log('No matching labels found for commits.');
}