diff --git a/.github/workflows/weekcheck.yaml b/.github/workflows/weekcheck.yaml new file mode 100644 index 000000000..98072b137 --- /dev/null +++ b/.github/workflows/weekcheck.yaml @@ -0,0 +1,45 @@ +name: Week Check πŸ—“οΈ + +on: + schedule: + # 맀일 μ˜€μ „ 10μ‹œ, μ˜€ν›„ 6μ‹œ (KST κΈ°μ€€, UTCλ‘œλŠ” 1μ‹œ, 9μ‹œ) + - cron: "0 1,9 * * *" + workflow_dispatch: + pull_request: + +jobs: + check-all-prs: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Check all PRs via GitHub App + id: check + run: | + echo "πŸ” GitHub App을 톡해 λͺ¨λ“  Open PR 검사 쀑..." + + response=$(curl -s -X POST "https://github.dalestudy.com/check-weeks" \ + -H "Content-Type: application/json" \ + -d "{\"repo_owner\": \"${{ github.repository_owner }}\", \"repo_name\": \"${{ github.event.repository.name }}\"}") + + echo "response=$response" >> $GITHUB_OUTPUT + echo "$response" | jq '.' + + - name: Summary + run: | + response='${{ steps.check.outputs.response }}' + + total=$(echo "$response" | jq -r '.total_prs // 0') + checked=$(echo "$response" | jq -r '.checked // 0') + commented=$(echo "$response" | jq -r '.commented // 0') + deleted=$(echo "$response" | jq -r '.deleted // 0') + + echo "## 🎯 Week μ„€μ • 체크 μ™„λ£Œ" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "- πŸ“‹ 전체 Open PR: **$total**개" >> $GITHUB_STEP_SUMMARY + echo "- βœ… κ²€μ‚¬ν•œ PR: **$checked**개" >> $GITHUB_STEP_SUMMARY + echo "- πŸ’¬ λŒ“κΈ€ μž‘μ„±ν•œ PR: **$commented**개" >> $GITHUB_STEP_SUMMARY + echo "- πŸ—‘οΈ λŒ“κΈ€ μ‚­μ œν•œ PR: **$deleted**개" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "λ‹€μŒ 체크: $(date -u -d '+1 hour' +'%Y-%m-%d %H:00 UTC')" >> $GITHUB_STEP_SUMMARY