name: Check Duplicates on: issues: 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 "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 }}"} ] }] }' env: OPENAI_KEY: ${{ secrets.OPENAI_KEY }}