Skip to content

Commit

Permalink
[feature] slack 알림 전송 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
Yun-YeoJun committed Feb 6, 2025
1 parent 961ede0 commit 4ba2672
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,33 @@ jobs:
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: "**/build/test-results/test/TEST-*.xml"
files: "**/build/test-results/test/TEST-*.xml"

slack-reporting:
runs-on: ubuntu-latest
needs: [ formatting, unit-test ]
if: always()
steps:
- name: Determine final status
id: check_status
run: |
results=("build" "test" "deploy")
for job in "${results[@]}"; do
if [[ "${{ needs[$job].result }}" == "failure" || "${{ needs[$job].result }}" == "cancelled" ]]; then
echo "status=failure" >> $GITHUB_ENV
exit 0
fi
done
echo "status=success" >> $GITHUB_ENV
- name: Send Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_MESSAGE: |
*GitHub Actions 결과*
- Repository: ${{ github.repository }}
- Branch: ${{ github.ref }}
- Commit: ${{ github.sha }}
- Result: *${{ env.status }}*
SLACK_COLOR: ${{ env.status == 'success' && 'good' || 'danger' }}

0 comments on commit 4ba2672

Please sign in to comment.