fix: 추천 공고 목록 조회 #13
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: PinHouse-BE 버그 알림 파이프라인 | |
| # 다시 열린 이슈도 포함 | |
| on: | |
| issues: | |
| types: [ opened, reopened ] | |
| # 환경 변수 설정 | |
| env: | |
| USER_MAP_JSON: ${{ secrets.USER_MAP_JSON }} | |
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| DISCORD_ROLE: ${{ secrets.DISCORD_ROLE }} | |
| DISCORD_AVATAR_URL: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png | |
| # Job | |
| jobs: | |
| notify-bug-issue: | |
| runs-on: ubuntu-22.04 | |
| if: contains(github.event.issue.labels.*.name, 'bug') | |
| environment: PinHouse_bug | |
| steps: | |
| - name: 데이터 준비 | |
| id: prep | |
| run: | | |
| # 1. 멘션 처리 함수 (사용자 매핑 로직 강화) | |
| get_mention() { | |
| local login=$1 | |
| local mapped=$(echo "$USER_MAP_JSON" | jq -r --arg id "$login" '.[$id] // empty') | |
| if [ -n "$mapped" ]; then echo "$mapped"; else echo "@$login"; fi | |
| } | |
| # 2. 작성자 및 담당자 멘션 생성 | |
| AUTHOR=$(get_mention "${{ github.event.issue.user.login }}") | |
| echo "author=$AUTHOR" >> $GITHUB_OUTPUT | |
| ASSIGNEES=$(echo '${{ toJson(github.event.issue.assignees) }}' | jq -r --argjson map "$USER_MAP_JSON" ' | |
| [.[].login | ($map[.] // "@" + .)] | join(", ") | |
| ') | |
| echo "assignees=${ASSIGNEES:-'미지정 👤'}" >> $GITHUB_OUTPUT | |
| # 3. 라벨을 예쁘게 포맷팅 (예: `bug`, `p0`) | |
| LABELS=$(echo '${{ toJson(github.event.issue.labels.*.name) }}' | jq -r 'map("`" + . + "`") | join(", ")') | |
| echo "labels=$LABELS" >> $GITHUB_OUTPUT | |
| - name: Discord 알림 전송 | |
| uses: sarisia/actions-status-discord@v1 | |
| with: | |
| webhook: ${{ env.DISCORD_WEBHOOK_URL }} | |
| status: 'failure' | |
| title: '🚨 BUG REPORT: ${{ github.event.issue.title }}' | |
| url: ${{ github.event.issue.html_url }} | |
| # 2. 역할 멘션은 content에 그대로 두어 최상단에 노출되게 합니다. | |
| content: '${{ env.DISCORD_ROLE }} 버그가 접수되었습니다. 확인 부탁드립니다!' | |
| description: | | |
| **레포지토리** | |
| ${{ github.event.repository.full_name }} (FE) | |
| **작성자** | |
| ${{ steps.prep.outputs.author }} | |
| **담당자** | |
| ${{ steps.prep.outputs.assignees }} | |
| **라벨** | |
| ${{ steps.prep.outputs.labels }} | |
| **📝 내용** | |
| ```text | |
| ${{ github.event.issue.body }} | |
| ``` | |
| # 4. 기타 스타일 옵션 | |
| color: 0xff4d4d | |
| username: GitHub BE Bug Bot | |
| avatar_url: ${{ env.DISCORD_AVATAR_URL }} |