1.1.8 minor update #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 "**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 content "@everyone" \ | |
| --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, | |
| content: $content, | |
| allowed_mentions: { parse: ["everyone"] }, | |
| embeds: [ | |
| { | |
| title: $title, | |
| description: $description, | |
| color: $color, | |
| footer: { text: "VVunderlore Toolkit" }, | |
| timestamp: $timestamp | |
| } | |
| ] | |
| }' > payload.json | |
| - name: Send to Discord | |
| env: | |
| DISCORD_WEBHOOK: ${{ secrets.WEBHOOK_URL }} | |
| run: | | |
| set -e | |
| code=$(curl -sS -o resp.txt -w "%{http_code}" \ | |
| -H "Content-Type: application/json" \ | |
| -X POST "$DISCORD_WEBHOOK?wait=true" \ | |
| -d @payload.json) | |
| echo "HTTP $code" | |
| cat resp.txt | |
| test "$code" -ge 200 -a "$code" -lt 300 |