Fix GitHub Actions workflow — secrets not allowed in if expressions
- Move secret to env var, check emptiness in shell instead - Gracefully skips if DISCORD_ANNOUNCEMENTS_WEBHOOK not configured
This commit is contained in:
parent
46cbadf47c
commit
a81031d63f
1 changed files with 5 additions and 2 deletions
7
.github/workflows/docker-publish.yml
vendored
7
.github/workflows/docker-publish.yml
vendored
|
|
@ -43,8 +43,11 @@ jobs:
|
|||
boulderbadgedad/soulsync:${{ inputs.version_tag }}
|
||||
|
||||
- name: Announce release to Discord
|
||||
if: success() && secrets.DISCORD_ANNOUNCEMENTS_WEBHOOK
|
||||
if: success()
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_ANNOUNCEMENTS_WEBHOOK }}
|
||||
run: |
|
||||
if [ -z "$DISCORD_WEBHOOK" ]; then echo "No webhook configured, skipping"; exit 0; fi
|
||||
curl -s -H "Content-Type: application/json" \
|
||||
-d "{\"embeds\": [{\"title\": \"SoulSync v${{ inputs.version_tag }} Released\", \"description\": \"A new version of SoulSync is available! Pull the latest Docker image to update.\n\n\`\`\`\ndocker pull boulderbadgedad/soulsync:${{ inputs.version_tag }}\n\`\`\`\", \"color\": 5025616, \"footer\": {\"text\": \"SoulSync Auto-Release\"}, \"timestamp\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}]}" \
|
||||
"${{ secrets.DISCORD_ANNOUNCEMENTS_WEBHOOK }}"
|
||||
"$DISCORD_WEBHOOK"
|
||||
|
|
|
|||
Loading…
Reference in a new issue