one secret for each event type

This commit is contained in:
Sina Mahmoodi 2025-03-18 19:13:11 +01:00
parent 1ef1ae48d1
commit 888120203a

View file

@ -7,14 +7,27 @@ on:
types: [opened, merged] types: [opened, merged]
jobs: jobs:
notify: notify-discord:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: Ilshidur/action-discord@master - name: Notify Discord about Issues
if: github.event_name == 'issues'
uses: Ilshidur/action-discord@master
env: env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} DISCORD_WEBHOOK: ${{ secrets.DISCORD_ISSUES_WEBHOOK }}
with: with:
args: > args: >
New **${{ github.event_name }}**: **Issue** ${{ github.event.action }}:
[#${{ github.event.issue.number || github.event.pull_request.number }} - ${{ github.event.issue.title || github.event.pull_request.title }}](${{ github.event.issue.html_url || github.event.pull_request.html_url }}) [#${{ github.event.issue.number }} ${{ github.event.issue.title }}](${{ github.event.issue.html_url }})
by **${{ github.actor }}**
- name: Notify Discord about Pull Requests
if: github.event_name == 'pull_request'
uses: Ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_PRS_WEBHOOK }}
with:
args: >
**PR** ${{ github.event.action }}:
[#${{ github.event.pull_request.number }} ${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})
by **${{ github.actor }}** by **${{ github.actor }}**