32 lines
No EOL
1 KiB
YAML
32 lines
No EOL
1 KiB
YAML
name: Check Duplicates
|
|
|
|
on:
|
|
issue:
|
|
types: [opened]
|
|
|
|
jobs:
|
|
check_duplicates:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
title: ${{ github.event.issue.title }}
|
|
body: ${{ github.event.issue.title }}
|
|
steps:
|
|
- name: Search for similar issues
|
|
run: echo "issues=$(gh issue list --search '${{ env.title }}' --json title,body,url)" >> $GITHUB_ENV
|
|
- name: Send message to GPT
|
|
run: |
|
|
curl -X POST \
|
|
https://api.openai.com/v1/chat/completions \
|
|
-H "Content-Type: application/json" \
|
|
-H "Authorization: Bearer ${{ secrets.OPENAI_KEY }}" \
|
|
-d '{
|
|
"model": "gpt-3.5-turbo",
|
|
"messages": [
|
|
{"role": "user", "content": "Please link possible duplications of this issue."},
|
|
{"role": "user", "content": "${{ env.title }}\n${{ env.body }}"},
|
|
{"role": "user", "content": "${{ env.issues }}"}
|
|
],
|
|
"temperature": 0.7
|
|
}'
|
|
env:
|
|
OPENAI_KEY: ${{ secrets.OPENAI_KEY }} |