fix steam-alpha pipeline (#83)
use custom discord action instead of broken one
This commit is contained in:
57
.github/actions/discord-webhook/action.yml
vendored
Normal file
57
.github/actions/discord-webhook/action.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
name: "Discord Webhook"
|
||||||
|
description: "Send a message to Discord via webhook using curl"
|
||||||
|
inputs:
|
||||||
|
webhook_url:
|
||||||
|
description: "Discord webhook URL"
|
||||||
|
required: true
|
||||||
|
message:
|
||||||
|
description: "Message to send"
|
||||||
|
required: true
|
||||||
|
username:
|
||||||
|
description: "Override the default username of the webhook"
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
avatar_url:
|
||||||
|
description: "Override the default avatar of the webhook"
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
color:
|
||||||
|
description: "Embed color (decimal number)"
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Send Discord notification
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [ -n "${{ inputs.color }}" ]; then
|
||||||
|
# Send as embed with color
|
||||||
|
PAYLOAD=$(jq -n \
|
||||||
|
--arg content "${{ inputs.message }}" \
|
||||||
|
--arg username "${{ inputs.username }}" \
|
||||||
|
--arg avatar "${{ inputs.avatar_url }}" \
|
||||||
|
--arg color "${{ inputs.color }}" \
|
||||||
|
'{
|
||||||
|
content: (if $content != "" then $content else null end),
|
||||||
|
username: (if $username != "" then $username else null end),
|
||||||
|
avatar_url: (if $avatar != "" then $avatar else null end),
|
||||||
|
embeds: (if $color != "" then [{description: $content, color: ($color | tonumber)}] else null end)
|
||||||
|
} | with_entries(select(.value != null))')
|
||||||
|
else
|
||||||
|
# Send as simple message
|
||||||
|
PAYLOAD=$(jq -n \
|
||||||
|
--arg content "${{ inputs.message }}" \
|
||||||
|
--arg username "${{ inputs.username }}" \
|
||||||
|
--arg avatar "${{ inputs.avatar_url }}" \
|
||||||
|
'{
|
||||||
|
content: $content,
|
||||||
|
username: (if $username != "" then $username else null end),
|
||||||
|
avatar_url: (if $avatar != "" then $avatar else null end)
|
||||||
|
} | with_entries(select(.value != null))')
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl -H "Content-Type: application/json" \
|
||||||
|
-d "$PAYLOAD" \
|
||||||
|
"${{ inputs.webhook_url }}"
|
||||||
6
.github/workflows/steam_alpha.yml
vendored
6
.github/workflows/steam_alpha.yml
vendored
@@ -86,7 +86,7 @@ jobs:
|
|||||||
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
|
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Discord notification
|
- name: Discord notification
|
||||||
uses: appleboy/discord-action@v1.2.0
|
uses: ./.github/actions/discord-webhook
|
||||||
with:
|
with:
|
||||||
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
|
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
message: New macos release (`${{ steps.vars.outputs.branch }}`) [`${{ steps.vars.outputs.sha_short }}`]
|
message: New macos release (`${{ steps.vars.outputs.branch }}`) [`${{ steps.vars.outputs.sha_short }}`]
|
||||||
@@ -168,7 +168,7 @@ jobs:
|
|||||||
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
|
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Discord notification
|
- name: Discord notification
|
||||||
uses: appleboy/discord-action@v1.2.0
|
uses: ./.github/actions/discord-webhook
|
||||||
with:
|
with:
|
||||||
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
|
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
message: New steamos release (`${{ steps.vars.outputs.branch }}`) [`${{ steps.vars.outputs.sha_short }}`]
|
message: New steamos release (`${{ steps.vars.outputs.branch }}`) [`${{ steps.vars.outputs.sha_short }}`]
|
||||||
@@ -224,7 +224,7 @@ jobs:
|
|||||||
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
|
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Discord notification
|
- name: Discord notification
|
||||||
uses: appleboy/discord-action@v1.2.0
|
uses: ./.github/actions/discord-webhook
|
||||||
with:
|
with:
|
||||||
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
|
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
message: New windows release (`${{ steps.vars.outputs.branch }}`) [`${{ steps.vars.outputs.sha_short }}`]
|
message: New windows release (`${{ steps.vars.outputs.branch }}`) [`${{ steps.vars.outputs.sha_short }}`]
|
||||||
|
|||||||
Reference in New Issue
Block a user