Skip to content

Fix: link for '미로탐색' problem in week 8 #71

Fix: link for '미로탐색' problem in week 8

Fix: link for '미로탐색' problem in week 8 #71

name: Notify Slack on Push to main
on:
push:
branches: [main]
jobs:
notify:
runs-on: ubuntu-latest
env:
TZ: Asia/Seoul
steps:
- name: Get KST time
run: echo "KST_NOW=$(date '+%Y-%m-%d %H:%M KST')" >> "$GITHUB_ENV"
- name: Build payload (single commit summary)
id: payload
uses: actions/github-script@v7
env:
KST_NOW: ${{ env.KST_NOW }}
with:
script: |
const commit = (context.payload.commits || [])[0];
const msg = commit ? commit.message.split('\n')[0] : '— (no commit) —';
const text =
`main 브랜치 업데이트\n` +
`푸시한 유저: ${context.actor}\n` +
`시간(KST): ${process.env.KST_NOW}\n` +
`커밋 요약:\n` +
`• ${msg}`;
core.setOutput('json', JSON.stringify({ text }));
- name: Post to Slack
uses: slackapi/[email protected]
with:
payload: ${{ steps.payload.outputs.json }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK