docs(readme): README 작성 #57
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/auto-assign-action@v1.2.5 | |
| 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.'); | |
| } |