Week48 문제풀이
#2
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: Automation PR | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| jobs: | |
| pr-tasks: | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: run assign_reviewers script | |
| id: assign_step # 이 ID가 두 스텝을 이어주는 다리 역할을 합니다. | |
| uses: actions/github-script@v7 | |
| env: | |
| SCRIPT_FULL_PATH: ${{ github.workspace }}/.github/scripts/assign-reviewers.js | |
| with: | |
| script: | | |
| const { default: assign } = await import(process.env.SCRIPT_FULL_PATH); | |
| return await assign({ github, context, core }); | |
| - name: send discord notification | |
| if: steps.assign_step.outputs.result != 'null' | |
| uses: actions/github-script@v6 | |
| env: | |
| DISCORD_CHANNEL_ID: ${{ vars.DISCORD_CHANNEL_ID_PR }} | |
| BOT_TOKEN: ${{ secrets.BOT_TOKEN_NOTIFIER }} | |
| SCRIPT_FULL_PATH: ${{ github.workspace }}/.github/scripts/senders/notifier-pr.js | |
| RESULT_DATA: ${{ steps.assign_step.outputs.result }} | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const { default: notify } = await import(process.env.SCRIPT_FULL_PATH); | |
| const data = JSON.parse(process.env.RESULT_DATA); | |
| await notify({ github, context, core, data }); |