chore: Follow up find duplications workflow

This commit is contained in:
Christian Kußowski 2025-05-18 10:16:08 +02:00
commit ab0c06ec1f
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -13,19 +13,18 @@ jobs:
steps: steps:
- name: Search for similar issues - name: Search for similar issues
run: echo "issues=$(gh issue list --search '${{ env.title }}' --json title,body,url)" >> $GITHUB_ENV run: echo "issues=$(gh issue list --search '${{ env.title }}' --json title,body,url)" >> $GITHUB_ENV
- name: Send message to GPT - name: Let Gemini reply
run: | run: |
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=${{ secrets.GEMINI_KEY }}" \ RESPONSE=$(curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=${{ secrets.GEMINI_KEY }}" \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-X POST \ -X POST \
-d '{ -d '{
"contents": [{ "contents": [{
"parts":[ "parts":[
{"text": "Please write a very short and nice response to this new issue and link possible duplications."}, {"text": "Please write a very short and nice response to this new issue and link possible duplications.\n\n${{ env.title }}\n${{ env.body }}\n\nPossible Duplications:\n${{ env.issues }}"}
{"text": "${{ env.title }}\n${{ env.body }}"},
{"text": "${{ env.issues }}"}
] ]
}] }]
}' }' | jq -r '.candidates[0].content.parts[0].text')
gh issue comment ${{ github.event.issue.number }} --body "$RESPONSE"
env: env:
OPENAI_KEY: ${{ secrets.OPENAI_KEY }} OPENAI_KEY: ${{ secrets.OPENAI_KEY }}