mirror of
https://github.com/DS4SD/docling.git
synced 2025-12-08 12:48:28 +00:00
chore: add action posting to discord (#2486)
* add action posting to discord Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * test on push Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * with icon Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * remove testing Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> --------- Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
37
.github/workflows/discord-release.yml
vendored
Normal file
37
.github/workflows/discord-release.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# .github/workflows/discord-release.yml
|
||||||
|
name: Notify Discord on Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
discord:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Send release info to Discord
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK: ${{ secrets.RELEASES_DISCORD_WEBHOOK }}
|
||||||
|
run: |
|
||||||
|
REPO_NAME=${{ github.repository }}
|
||||||
|
RELEASE_TAG=${{ github.event.release.tag_name }}
|
||||||
|
RELEASE_NAME="${{ github.event.release.name }}"
|
||||||
|
RELEASE_URL=${{ github.event.release.html_url }}
|
||||||
|
RELEASE_BODY="${{ github.event.release.body }}"
|
||||||
|
|
||||||
|
# Fallback if release name is empty
|
||||||
|
if [ -z "$RELEASE_NAME" ]; then
|
||||||
|
RELEASE_NAME=$RELEASE_TAG
|
||||||
|
fi
|
||||||
|
|
||||||
|
PAYLOAD=$(jq -n \
|
||||||
|
--arg title "🚀 New Release: $RELEASE_NAME" \
|
||||||
|
--arg url "$RELEASE_URL" \
|
||||||
|
--arg desc "$RELEASE_BODY" \
|
||||||
|
--arg author_name "$REPO_NAME" \
|
||||||
|
--arg author_icon "https://github.com/docling-project.png" \
|
||||||
|
'{embeds: [{title: $title, url: $url, description: $desc, color: 5814783, author: {name: $author_name, icon_url: $author_icon}}]}')
|
||||||
|
|
||||||
|
curl -H "Content-Type: application/json" \
|
||||||
|
-d "$PAYLOAD" \
|
||||||
|
"$DISCORD_WEBHOOK"
|
||||||
Reference in New Issue
Block a user