Files
crm_ecosplay/.gitea/workflows/discord-notify.yml
Serreau Jovann 6fa970e60d refactor: rebrand project to CRM SITECONSEIL (SARL SITECONSEIL)
- Rename all references from E-Cosplay/Ecosplay to SITECONSEIL
- Update entity from Association to SARL SITECONSEIL (Siret: 418664058)
- Update address to 27 rue Le Serurier, 02100 Saint-Quentin
- Update emails: contact@siteconseil.fr, rgpd@siteconseil.fr
- Update hosting from GCP to OVHcloud (Roubaix, Gravelines, Strasbourg, Paris)
- Update legal pages: mentions legales, CGV, RGPD, conformite, hebergement, cookies, CGU
- Add tarifs page with tabs: Site Internet, E-Commerce, Nom de domaine, Esy-Mail, Esy-Mailer, Esy-Tchat, Esy-Meet, Esy-Defender
- Add Discord webhook notification workflow
- Disable deploy and sonarqube workflows
- Update OAuth Keycloak realm to master
- Update logo references to logo_facture.png
- Remove forced image sizing in Liip Imagine filters
- Update SonarQube project key and badge token
- Update tribunal competent to Saint-Quentin
- Move tarif tabs JS to app.js (CSP compliance)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:48:25 +02:00

71 lines
3.1 KiB
YAML

name: Discord Notification
on:
push:
jobs:
notify:
runs_on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Send Discord Embed
run: |
REPO_NAME="${{ gitea.repository }}"
BRANCH="${{ gitea.ref_name }}"
AUTHOR="${{ gitea.actor }}"
COMMIT_SHA="${{ gitea.sha }}"
SHORT_SHA="${COMMIT_SHA:0:7}"
COMMIT_URL="${{ gitea.server_url }}/${REPO_NAME}/commit/${COMMIT_SHA}"
REPO_URL="${{ gitea.server_url }}/${REPO_NAME}"
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
COMMIT_MSG=$(git log -1 --pretty=format:'%s' | head -c 256)
COMMIT_BODY=$(git log -1 --pretty=format:'%b' | head -c 1024)
FILES_CHANGED=$(git diff --stat HEAD~1 HEAD 2>/dev/null | tail -1 || echo "N/A")
FILES_LIST=$(git diff --name-only HEAD~1 HEAD 2>/dev/null | head -20 | sed 's/^/• /' || echo "N/A")
FILE_COUNT=$(git diff --name-only HEAD~1 HEAD 2>/dev/null | wc -l || echo "0")
if [ "$FILE_COUNT" -gt 20 ]; then
REMAINING=$((FILE_COUNT - 20))
FILES_LIST="${FILES_LIST}\n... et ${REMAINING} autres fichiers"
fi
DESCRIPTION="${COMMIT_MSG}"
if [ -n "$COMMIT_BODY" ]; then
DESCRIPTION="${DESCRIPTION}\n\n${COMMIT_BODY}"
fi
FIELDS="["
FIELDS="${FIELDS}{\"name\":\"Branche\",\"value\":\"\`${BRANCH}\`\",\"inline\":true},"
FIELDS="${FIELDS}{\"name\":\"Commit\",\"value\":\"[\`${SHORT_SHA}\`](${COMMIT_URL})\",\"inline\":true},"
FIELDS="${FIELDS}{\"name\":\"Auteur\",\"value\":\"${AUTHOR}\",\"inline\":true},"
FIELDS="${FIELDS}{\"name\":\"Statistiques\",\"value\":\"\`\`\`${FILES_CHANGED}\`\`\`\",\"inline\":false},"
FIELDS="${FIELDS}{\"name\":\"Fichiers modifies\",\"value\":\"\`\`\`${FILES_LIST}\`\`\`\",\"inline\":false}"
FIELDS="${FIELDS}]"
PAYLOAD=$(cat <<EOFPAYLOAD
{
"embeds": [{
"title": "DEPOT CRM SITECONSEIL",
"description": $(echo -e "$DESCRIPTION" | jq -Rs .),
"url": "${COMMIT_URL}",
"color": 16244476,
"fields": ${FIELDS},
"footer": {
"text": "${REPO_NAME}"
},
"timestamp": "${TIMESTAMP}"
}]
}
EOFPAYLOAD
)
curl -s -X POST \
-H "Content-Type: application/json" \
-d "${PAYLOAD}" \
"https://discord.com/api/webhooks/1419573620602044518/ikAdxWxsrrTqMTb5Gh_8ylcoJHlOnq7aJZvR5udoS_fCK56Jk3qpEnJHVKdD8fwuNJF3"