Skip to content

Update .version.json #8

Update .version.json

Update .version.json #8

name: Notify Discord on version change
on:
push:
paths:
- ".version.json"
jobs:
notify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Discord embed
id: build
shell: bash
run: |
set -euo pipefail
VERSION="$(jq -r '.version' .version.json)"
TITLE="VVunderlore Toolkit v${VERSION}"
{
echo "Hey a new version of the VVunderlore Toolkit is available. It's version **${VERSION}**."
echo
echo "**Changelog:**"
echo
cat README.md || true
} > desc.txt
jq -n \
--arg username "Update Peddler" \
--arg avatar "https://publish-01.obsidian.md/access/6eeb85818256487c684eecfe4fbff970/Extras/Toolkit/Images/update_peddler.jpg" \
--arg title "$TITLE" \
--rawfile description desc.txt \
--argjson color 14592 \
--arg timestamp "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
'{
username: $username,
avatar_url: $avatar,
embeds: [
{
title: $title,
description: $description,
color: $color,
footer: { text: "VVunderlore Toolkit" },
timestamp: $timestamp
}
]
}' > payload.json