Skip to content

🐞 공통으로 사용하는 이벤트 타입의 정의가 잘못됨 #16

🐞 공통으로 사용하는 이벤트 타입의 정의가 잘못됨

🐞 공통으로 사용하는 이벤트 타입의 정의가 잘못됨 #16

name: Add Issue to Project
on:
issues:
types:
- opened
env:
PROJECT_NUMBER: 19
jobs:
add-labels-to-issue:
name: Add Labels to Issue
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
script: |
const issueTitle = context.payload.issue.title;
const labelList = [
{ icon: '🔮', label: 'epic' },
{ icon: '📗', label: 'story' },
{ icon: '✅', label: 'feature' },
{ icon: '🐞', label: 'bug' },
{ icon: '🔄', label: 'refactor' }
];
const labels = labelList.reduce((acc, { icon, label }) => {
if(issueTitle.indexOf(icon) > -1) {
acc.push(label);
}
return acc;
}, []);
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels,
});
add-issue-to-project:
name: Add Issue to Project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: https://github.com/orgs/boostcampwm2023/projects/${{ env.PROJECT_NUMBER }}
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}