Skip to content

Commit

Permalink
Update check-open-prs.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
SeoGeonhyuk authored Nov 19, 2024
1 parent 9b4833d commit 8c6a816
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/check-open-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ jobs:
# 모든 열린 PR 가져오기
prs=$(gh pr list --json number,title,url,reviewRequests --jq '.[] | select(.reviewRequests | length > 0)')
# PR 데이터 확인 (디버깅용)
echo "prs=$prs" # PR 데이터 출력
echo "prs=$prs" >> $GITHUB_OUTPUT # GITHUB_OUTPUT에 PR 데이터 저장
# PR 데이터 출력 (디버깅용)
echo "Found PRs: $prs"
# GITHUB_OUTPUT에 PR 데이터를 저장
echo "prs=$prs" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub 기본 제공 토큰
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# 3. Slack 알림 전송
- name: Notify Slack
Expand All @@ -53,14 +55,19 @@ jobs:
# Slack 메시지 작성
message=":rotating_light: *Review가 필요한 Pull Requests 목록*\n\n"
# PR 제목만 추출하여 Slack 메시지에 추가
echo "$prs_json" | jq -r '.[] | "🔹 *<\(.url)|\(.title)>*"' | while read -r line; do
message+="$line\n"
# PR 제목만 Slack 메시지에 추가
for pr in $(echo "$prs_json" | tr -d '[]' | tr -d '{}'); do
# PR에서 제목만 추출
title=$(echo "$pr" | grep -oP '"title":\s*"\K[^"]+')
url=$(echo "$pr" | grep -oP '"url":\s*"\K[^"]+')
# 메시지에 추가
message+="🔹 *<$url|$title>*\n"
done
# Slack 메시지 푸터 추가
message+="\n:point_right: 리뷰를 부탁드립니다!"
# Slack 메시지 확인 (디버깅)
echo "Message to Slack: $message"
Expand Down

0 comments on commit 8c6a816

Please sign in to comment.