From afe2f8e76c875b5a81e8dcf95bb51c0da33b8586 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 00:48:11 +0700 Subject: [PATCH] fix --- .github/workflows/build-deploy.yml | 9 ++++++++- .github/workflows/send-message.yml | 13 +++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 71038ba..eb50017 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -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 diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index b596d7c..156fe7a 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -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: @@ -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\": [ @@ -28,4 +37,4 @@ jobs: } ] }" \ - ${{ secrets.RPKM67_DISCORD_WEBHOOK_URL }} \ No newline at end of file + ${{ inputs.webhook_url }} \ No newline at end of file