forked from jomjol/AI-on-the-edge-device
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1.07 KB
/
discussion.bot.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# 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