Reply-Bot #77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reply Bot | |
name: Reply-Bot | |
on: | |
discussion: | |
types: [created] | |
permissions: | |
contents: read | |
issues: write | |
pull-requests: write | |
discussions: write | |
jobs: | |
bot-response: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: setup | |
run: | | |
pip install markdown | |
- 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 |