Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Jul 21, 2024
1 parent 57bb2cf commit afe2f8e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ env:

jobs:
send_message:
uses: ./.github/workflows/send-message.yml
name: Send Messages
runs-on: ubuntu-latest

steps:
- uses: ./.github/workflows/send-message.yml
with:
webhook_url: ${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }}
discord_api_key: ${{ secrets.RPKM67_DISCORD_API_KEY }}

build:
name: Build
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/send-message.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ name: Send Messages

on:
workflow_call:
inputs:
webhook_url:
description: 'The webhook URL of the Discord channel'
required: true
type: string
discord_api_key:
description: 'The API key of the Discord bot'
required: true
type: string

jobs:
send_message:
Expand All @@ -11,7 +20,7 @@ jobs:
- name: Send message to Discord
run: |
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bot ${{ secrets.RPKM67_DISCORD_API_KEY }}" \
-H "Authorization: Bot ${{ inputs.discord_api_key }}" \
-d "{
\"content\": \"A new push has been made to the **${{ github.event.pull_request.base.ref }}** branch by ${{ github.actor }}!\",
\"embeds\": [
Expand All @@ -28,4 +37,4 @@ jobs:
}
]
}" \
${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }}
${{ inputs.webhook_url }}

0 comments on commit afe2f8e

Please sign in to comment.