Skip to content

Issue and Discussions Trigger #322

Issue and Discussions Trigger

Issue and Discussions Trigger #322

Workflow file for this run

name: Issue and Discussions Trigger
on:
issues:
types: [opened]
discussion:
types: [created]
jobs:
send_message:
runs-on: ubuntu-latest
steps:
- name: Send message
run: |
generate_post_data(){
text="有新的 Discussion: https://github.com/he3-app/he3-feedback/issues/new?created_from_discussion_number=${{ github.event.discussion.number }}"
if [ ${{ github.event_name }} == "issues" ]; then
text="有新的 Issue: https://github.com/he3-app/he3-feedback/issues/${{ github.event.issue.number }}"
fi
cat <<EOF
{
"msg_type": "text",
"content": {
"text": "$text"
}
}
EOF
}
curl -X POST -H "Content-Type: application/json" \
-d "$(generate_post_data)" \
https://open.feishu.cn/open-apis/bot/v2/hook/${{ secrets.FEISHU_BOT_WEBHOOK_URL }}