Skip to content

[FEATURE & FIX] userId -1 검증 aop 구현, grant role userId 검증 추가 #485

[FEATURE & FIX] userId -1 검증 aop 구현, grant role userId 검증 추가

[FEATURE & FIX] userId -1 검증 aop 구현, grant role userId 검증 추가 #485

name: "Pick Random Reviwer"
on:
pull_request:
types:
- opened
jobs:
pick-random-reviwer:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: pick_random_reviwer
id: pick_random_reviwer
uses: actions/github-script@v3
with:
github-token: ${{secrets.TOKEN}}
script: |
const review_team = ['sinryuji', 'Paul2021-R', 'weejihye', 'wochae'];
const candidate = review_team.filter((e) => e != '${{ github.event.pull_request.user.login }}');
const randomReviewer = candidate[Math.floor(Math.random() * candidate.length)];
const comment = `🎉 @${randomReviewer} 님 랜덤 리뷰어로 당첨되셨습니다! 리뷰를 부탁드립니다. 🙏`
core.setOutput('comment', comment)
core.setOutput('reviewer', randomReviewer)
- name: comment PR
uses: mshick/add-pr-comment@v1
with:
message: |
${{ steps.pick_random_reviwer.outputs.comment }}
repo-token: ${{ secrets.TOKEN }}
repo-token-user-login: 'github-actions[bot]'
- name: Add Pull Request Reviewer
uses: madrapps/add-reviewers@v1
with:
reviewers: ${{ steps.pick_random_reviwer.outputs.reviewer }}
token: ${{ secrets.TOKEN }}
# - name: pick_random_reviwer
# id: pick_random_reviwer
# uses: actions/github-script@v3
# with:
# github-token: ${{secrets.TOKEN}}
# script: |
# const team1 = ['sinryuji', 'Paul2021-R', 'weejihye', 'perman0519', 'juhyeonlee134', 'wochae'];
# const team2 = ['perman0519', 'juhyeonlee134', 'wochae'];
# const candidate1 = team1.filter((e) => e != '${{ github.event.pull_request.user.login }}');
# const candidate2 = team2.filter((e) => e != '${{ github.event.pull_request.user.login }}');
# const randomReviewer1 = candidate1[Math.floor(Math.random() * candidate1.length)];
# const randomReviewer2 = candidate2[Math.floor(Math.random() * candidate2.length)];
# const comment1 = `🎉 @${randomReviewer1} 님 랜덤 리뷰어로 당첨되셨습니다! 리뷰를 부탁드립니다. 🙏`
# const comment2 = `🎉 @${randomReviewer2} 님 랜덤 리뷰어로 당첨되셨습니다! 리뷰를 부탁드립니다. 🙏`
# core.setOutput('comment1', comment1)
# core.setOutput('comment2', comment2)
# core.setOutput('reviewer1', randomReviewer1)
# core.setOutput('reviewer2', randomReviewer2)