chore: Fix check duplicates

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

View file

@ -1,4 +1,4 @@
name: Check Duplicates name: Check duplicates
on: on:
issues: issues:
@ -14,18 +14,17 @@ jobs:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Search for similar issues - name: Check duplicates
run: echo "issues=$(gh issue list --search '${{ env.title }}')" >> $GITHUB_ENV
- name: Let Gemini reply
run: | run: |
echo "${{ env.issues }}" ISSUES=$(gh issue list --search '${{ env.title }}')
echo $ISSUES
RESPONSE=$(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 compare issue title and body to possible duplications. If you think this issue could be a duplication, write a short response to this Github issue and link the possible duplication issues and ask the author @$author to check those. Otherwise just responde with an empty String.\n\nIssue title: $title\nIssue body: $body\n\nPossible duplications:\n$issues\"} {\"text\": \"Please compare issue title and body to possible duplications. If you think this issue could be a duplication, write a short response to this Github issue and link the possible duplication issues and ask the author @$author to check those. Otherwise just responde with an empty String.\n\nIssue title: $title\nIssue body: $body\n\nPossible duplications:\n$ISSUES\"}
] ]
}] }]
}" | jq -r '.candidates[0].content.parts[0].text') }" | jq -r '.candidates[0].content.parts[0].text')