[#394] feat(guide): 가이드북 페이지 추가 #213
Workflow file for this run
This file contains hidden or 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: 🤖 Auto-assign & label PR | |
| on: | |
| pull_request: | |
| types: [opened] | |
| permissions: | |
| pull-requests: write | |
| issues: write | |
| jobs: | |
| auto: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Auto assign author & reviewers | |
| uses: kentaro-m/[email protected] | |
| with: | |
| configuration-path: .github/auto_assign.yml | |
| - name: Label by title keywords | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const title = context.payload.pull_request.title.toLowerCase(); | |
| const rules = [ | |
| { re: /\bfeat|feature\b/, label: 'feature' }, | |
| { re: /\bfix\b/, label: 'fix' }, | |
| { re: /\bbug\b/, label: 'bug' }, | |
| { re: /\bstyle\b/, label: 'style' }, | |
| { re: /\brefactor\b/, label: 'refactor' }, | |
| { re: /\bchore\b/, label: 'chore' }, | |
| { re: /\bdocs?\b/, label: 'docs' }, | |
| { re: /\btest(s)?\b/, label: 'test' }, | |
| ]; | |
| const matched = rules.filter(r => r.re.test(title)).map(r => r.label); | |
| if (matched.length) { | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| labels: matched | |
| }); | |
| core.info(`Added labels: ${matched.join(', ')}`); | |
| } else { | |
| core.info('No matching labels from title.'); | |
| } |