Skip to content

test-for-workflow

test-for-workflow #29

name: Trigger NeuralChat BOT
on: issue_comment
jobs:
issue_commented:
# This job only runs for issue comments
name: Issue comment
if: ${{ !github.event.issue.pull_request }}
runs-on: issues-node
steps:
- run: |
echo comment on issue $NUMBER
echo comment ${{ github.event.comment.body }}
echo assignee ${{ github.event.issue.assignees }}
echo issue id ${{ github.event.issue.id }}
echo comment id ${{ github.event.comment.id }}
comment_content="${{ github.event.comment.body }}"
issue_content="${{ github.event.issue.body }}"
echo ${issue_content}
if [[ ${comment_content} == "If you need help, please @NeuralChatBot" ]]; then
echo "ignore instructions"
elif [[ ${comment_content} == *"@NeuralChatBot"* ]]; then
echo ask for neuralchat ${issue_content}
response=$(curl -X POST -H "Content-Type: application/json" -d '{"prompt": "${issue_content}"}' http://127.0.0.1:8000/v1/chat/completions)
echo ${response}
#curl -L \
# -X POST \
# -H "Accept: application/vnd.github+json" \
# -H "Authorization: Bearer ${{ vars.TOKEN }}" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# https://api.github.com/repos/VincyZhang/intel-extension-for-transformers/issues/${{ github.event.issue.number }}/comments \
# -d '{"body":"${response}"}'
fi
env:
NUMBER: ${{ github.event.issue.number }}