fix: sub 클레임 값을 UUID로 변환해 Authentication 객체의 principal로 설정하도록 수정 #173
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: PR Title Labeler | |
| on: | |
| pull_request_target: | |
| types: [opened, edited, reopened] | |
| jobs: | |
| label-pr: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Label PR based on title | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const prTitle = context.payload.pull_request.title; | |
| const labelMap = [ | |
| { pattern: /^feat:/i, label: '✨ feat' }, | |
| { pattern: /^fix:/i, label: '🐞 fix' }, | |
| { pattern: /^chore:/i, label: '⚙️ chore' }, | |
| { pattern: /^docs:/i, label: '📃 docs' }, | |
| { pattern: /^refactor:/i, label: '🔨 refactor' }, | |
| { pattern: /^test:/i, label: '✅ test' }, | |
| { pattern: /^style:/i, label: '🎨 style' } | |
| ]; | |
| const labelsToAdd = Array.from( | |
| new Set( | |
| labelMap | |
| .filter(entry => entry.pattern.test(prTitle)) | |
| .map(entry => entry.label) | |
| ) | |
| ); | |
| if (labelsToAdd.length > 0) { | |
| await github.rest.issues.addLabels({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| labels: labelsToAdd | |
| }); | |
| core.info(`Added labels: ${labelsToAdd.join(', ')}`); | |
| } else { | |
| core.info('No matching labels found for PR title.'); | |
| } |