Rule Monitor Session #6
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: Rule Monitor Session | |
| on: | |
| schedule: | |
| - cron: "0 13 * * 0" | |
| workflow_dispatch: | |
| inputs: | |
| test: | |
| description: "날짜 체크 건너뛰기 (테스트용)" | |
| required: false | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: read | |
| discussions: write | |
| pull-requests: read | |
| issues: read | |
| jobs: | |
| monitor-rules: | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - name: checkout repository | |
| uses: actions/checkout@v4 | |
| - name: run rule_monitor_session script | |
| id: monitor_step | |
| uses: actions/github-script@v7 | |
| env: | |
| SCRIPT_FULL_PATH: ${{ github.workspace }}/.github/scripts/rule-monitor-session.js | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const test = '${{ inputs.test }}' === 'true'; | |
| const { default: run } = await import(process.env.SCRIPT_FULL_PATH); | |
| return await run({ github, context, core, test }); | |
| - name: send discord notification | |
| if: steps.monitor_step.outputs.discussion_title != 'null' && steps.monitor_step.outputs.result != '' | |
| uses: actions/github-script@v7 | |
| env: | |
| DISCORD_CHANNEL_ID: ${{ vars.DISCORD_CHANNEL_ID_POST }} | |
| BOT_TOKEN: ${{ secrets.BOT_TOKEN_NOTIFIER}} | |
| NOTIFIER_DISCUSSION_PATH: ${{ github.workspace }}/.github/scripts/senders/notifier-discussion.js | |
| RESULT_DATA: ${{ steps.monitor_step.outputs.result }} | |
| with: | |
| script: | | |
| const { default: notifyReport } = await import(process.env.NOTIFIER_DISCUSSION_PATH); | |
| const data = JSON.parse(process.env.RESULT_DATA); | |
| await notifyReport({ github, context, core, data }); |