diff --git a/.github/workflows/push-to-discord.yaml b/.github/workflows/push-to-discord.yaml index 65b4135..f60e6f1 100644 --- a/.github/workflows/push-to-discord.yaml +++ b/.github/workflows/push-to-discord.yaml @@ -1,14 +1,15 @@ name: Push To Discord Channel on Pull Request Closed on: - workflow_dispatch: - pull_request: - types: [synchronize] + pull_request_target: + types: + - closed branches: - main jobs: push-to-discord: + if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: @@ -19,6 +20,5 @@ jobs: uses: fjogeleit/http-request-action@v1.15.2 with: url: $ {{ secrets.GDSC_CAU_DISCORD_ARTICLES }} - method: 'POST' + method: "POST" data: '{ "embeds": [{ "author": { "name": "${{ github.event.pull_request.user.name }}" }, "title": "${{ github.event.pull_request.title }}", "description": "${{ github.event.pull_request.body }}", "color": "6393081" }] }' -