🔄 타로 해설 채팅 기록에 저장 안하기 #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- uses: actions/[email protected] | |
with: | |
project-url: https://github.com/orgs/boostcampwm2023/projects/${{ env.PROJECT_NUMBER }} | |
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} |