From b177c880e38a643f2894a3ec629d28392557648e Mon Sep 17 00:00:00 2001 From: extrawurst <776816+extrawurst@users.noreply.github.com> Date: Wed, 10 Dec 2025 12:47:10 +0100 Subject: [PATCH] fix steam-alpha pipeline (#83) use custom discord action instead of broken one --- .github/actions/discord-webhook/action.yml | 57 ++++++++++++++++++++++ .github/workflows/steam_alpha.yml | 6 +-- 2 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 .github/actions/discord-webhook/action.yml diff --git a/.github/actions/discord-webhook/action.yml b/.github/actions/discord-webhook/action.yml new file mode 100644 index 0000000..0a2ea7e --- /dev/null +++ b/.github/actions/discord-webhook/action.yml @@ -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 }}" diff --git a/.github/workflows/steam_alpha.yml b/.github/workflows/steam_alpha.yml index 4a8c0df..334c2b4 100644 --- a/.github/workflows/steam_alpha.yml +++ b/.github/workflows/steam_alpha.yml @@ -86,7 +86,7 @@ jobs: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT - name: Discord notification - uses: appleboy/discord-action@v1.2.0 + uses: ./.github/actions/discord-webhook with: webhook_url: ${{ secrets.DISCORD_WEBHOOK }} 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 - name: Discord notification - uses: appleboy/discord-action@v1.2.0 + uses: ./.github/actions/discord-webhook with: webhook_url: ${{ secrets.DISCORD_WEBHOOK }} 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 - name: Discord notification - uses: appleboy/discord-action@v1.2.0 + uses: ./.github/actions/discord-webhook with: webhook_url: ${{ secrets.DISCORD_WEBHOOK }} message: New windows release (`${{ steps.vars.outputs.branch }}`) [`${{ steps.vars.outputs.sha_short }}`]