Skip to content

[Fix] 1.0.0 리젝 요청 사항 수정 #194

[Fix] 1.0.0 리젝 요청 사항 수정

[Fix] 1.0.0 리젝 요청 사항 수정 #194

Workflow file for this run

name: Notify Discord of GitHub activity
on:
discussion:
types: [ created, answered ]
discussion_comment:
pull_request:
types: [ opened, reopened, closed ]
branches: [ main, dev ]
issue_comment:
types: [ created ]
issues:
types: [ opened, deleted, closed, reopened ]
release:
types: [ published ]
# Add other events here that you want to trigger the workflow on
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11.3
- name: Install dependencies
run: pip install requests
- name: Process webhook payload and notify Discord
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
run: |
payload=$(cat $GITHUB_EVENT_PATH)
event_type=$(jq -r ".\"${{ github.event_name }}\"" <<< $payload)
repository_name=$(jq -r '.repository.name' <<< $payload)
sender_username=$(jq -r '.sender.login' <<< $payload)
message="New event on $repository_name by $sender_username! <@&1048243176999235637>"
payload=$(jq --arg message "$message" '. + {content: $message}' <<< $payload)
curl -H "Content-Type: application/json" -X POST -d "$payload" $DISCORD_WEBHOOK_URL