From ab0c06ec1f799216645ddf76dd2fe871e93aade8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Sun, 18 May 2025 10:16:08 +0200 Subject: [PATCH] chore: Follow up find duplications workflow --- .github/workflows/check_duplicates.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check_duplicates.yaml b/.github/workflows/check_duplicates.yaml index f30bc034f..df7de1a99 100644 --- a/.github/workflows/check_duplicates.yaml +++ b/.github/workflows/check_duplicates.yaml @@ -13,19 +13,18 @@ jobs: 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 + - name: Let Gemini reply 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' \ -X POST \ -d '{ "contents": [{ "parts":[ - {"text": "Please write a very short and nice response to this new issue and link possible duplications."}, - {"text": "${{ env.title }}\n${{ env.body }}"}, - {"text": "${{ env.issues }}"} + {"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 }}"} ] }] - }' + }' | jq -r '.candidates[0].content.parts[0].text') + gh issue comment ${{ github.event.issue.number }} --body "$RESPONSE" env: OPENAI_KEY: ${{ secrets.OPENAI_KEY }} \ No newline at end of file