Skip to content

Discussion-Bot

Discussion-Bot #2

# Reply Bot for discussions
name: Discussion-Bot
# Trigger on new discussions
on:
discussion:
types: [created]
permissions:
contents: read
issues: write
pull-requests: write
discussions: write
jobs:
bot-response:
runs-on: ubuntu-24.04
steps:
- name: Check out the repository to the runner
uses: actions/checkout@v4
- name: analyze
id: analyze
env:
GH_DISCUSSION_ACTOR: ${{ github.actor }}
GH_DISCUSSION_TITLE: ${{ github.event.discussion.title }}
GH_DISCUSSION_BODY: ${{ github.event.discussion.body }}
run: |
python discussion-bot/bot.py
cat response.md
response="$(cat response.md | sed 's/$/\\n/g' | tr -d '\n')"
echo "$response"
echo "response=$response" >> $GITHUB_OUTPUT
- name: Run discussion-auto-responder
uses: wesleyscholl/discussion-auto-responder@v1.0.8
id: autoresponder-comment
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
comment_body: "${{ steps.analyze.outputs.response }}"
delay_milliseconds: 0