Handle Requested Changes #242
Workflow file for this run
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: 'Handle Requested Changes' | |
on: | |
pull_request_review: | |
types: [ submitted ] | |
jobs: | |
request_changes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Check if Changes Requested' | |
id: check | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
return context.payload.review.state === 'CHANGES_REQUESTED'; | |
- name: 'Change Label to ์์ ์์ฒญ' | |
if: steps.check.outputs.result == 'true' | |
uses: actions-ecosystem/action-add-labels@v1 | |
with: | |
labels: '์์ ์์ฒญ' | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: 'Remove Label ํ์ธ ์์ฒญ' | |
if: steps.check.outputs.result == 'true' | |
uses: actions-ecosystem/action-remove-labels@v1 | |
with: | |
labels: 'ํ์ธ ์์ฒญ' | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: 'Notify Assignee via Comment' | |
if: steps.check.outputs.result == 'true' | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const prNumber = context.payload.pull_request.number; | |
const assignee = context.payload.pull_request.user.login; | |
const body = `@${assignee} ๋ฆฌ๋ทฐ์์ ์์ ์์ฒญ์ด ์์ต๋๋ค. ํ์ธ ๋ถํ๋๋ฆฝ๋๋ค.`; | |
await github.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: prNumber, | |
body: body, | |
}); |