@@ -100,16 +100,33 @@ jobs:
100100 path : ./publish
101101 retention-days : 5
102102
103- - name : 📣 Notificar resultado en Teams
103+ # ===========================================
104+ # 📨 Notificación a Teams (versión productiva)
105+ # ===========================================
106+ - name : 📣 Notificar resultado en Microsoft Teams
104107 if : always()
105- 106- with :
107- webhook_url : ${{ secrets.MS_TEAMS_WEBHOOK }}
108- message : |
109- ${{ job.status == 'success' && '🟢 **Build exitosa**' || '🔴 **Build fallida**' }}
110- **Workflow:** ${{ github.workflow }}
111- **Versión:** ${{ steps.version.outputs.version }}
112- **Branch:** ${{ github.ref_name }}
113- **Actor:** ${{ github.actor }}
114- **Ejecutado:** ${{ github.run_id }}
115- theme_color : ${{ job.status == 'success' && '00FF00' || 'FF0000' }}
108+ run : |
109+ STATUS="${{ job.status }}"
110+ COLOR="#36a64f"
111+ EMOJI="🟢"
112+ if [ "$STATUS" != "success" ]; then
113+ COLOR="#FF0000"
114+ EMOJI="🔴"
115+ fi
116+
117+ MESSAGE="{
118+ \"@type\": \"MessageCard\",
119+ \"@context\": \"http://schema.org/extensions\",
120+ \"themeColor\": \"$COLOR\",
121+ \"summary\": \"Pipeline $STATUS\",
122+ \"sections\": [{
123+ \"activityTitle\": \"$EMOJI **.NET CI - Resultado: $STATUS**\",
124+ \"activitySubtitle\": \"**Workflow:** ${{ github.workflow }}<br>**Branch:** ${{ github.ref_name }}<br>**Actor:** ${{ github.actor }}\",
125+ \"text\": \"Versión: **${{ steps.version.outputs.version }}**<br>[Ver ejecución en GitHub Actions](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})\"
126+ }]
127+ }"
128+
129+ echo "📨 Enviando mensaje a Microsoft Teams..."
130+ curl -H "Content-Type: application/json" \
131+ -d "$MESSAGE" \
132+ ${{ secrets.MS_TEAMS_WEBHOOK }}
0 commit comments