ci: Experimental check for duplicate workflow
This commit is contained in:
parent
2f8547869f
commit
d4332d5705
2 changed files with 31 additions and 3 deletions
30
.github/workflows/check_duplicates.yaml
vendored
Normal file
30
.github/workflows/check_duplicates.yaml
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
name: Check Duplicates
|
||||||
|
|
||||||
|
on:
|
||||||
|
issue:
|
||||||
|
types: [opened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check_duplicates:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Search for similar issues
|
||||||
|
run: echo "ISSUES=$(gh issue list --search '${{ github.event.issue.title }}' --json title,body | jq '[.[] | {title, body: (.body[:200])}]')"
|
||||||
|
- name: Send message to GPT
|
||||||
|
if: "${{ env.ISSUES != '[]' }}"
|
||||||
|
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": "${{ github.event.issue.title }}\n${{ github.event.issue.body }}"},
|
||||||
|
{"role": "user", "content": "${{ env.ISSUES }}"}
|
||||||
|
],
|
||||||
|
"temperature": 0.7
|
||||||
|
}'
|
||||||
|
env:
|
||||||
|
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
|
||||||
|
|
@ -48,9 +48,7 @@ class ErrorReporter {
|
||||||
AdaptiveDialogAction(
|
AdaptiveDialogAction(
|
||||||
onPressed: () => launchUrl(
|
onPressed: () => launchUrl(
|
||||||
AppConfig.newIssueUrl.resolveUri(
|
AppConfig.newIssueUrl.resolveUri(
|
||||||
Uri(
|
Uri(queryParameters: {'template': 'bug_report.yaml'}),
|
||||||
queryParameters: {'template': 'bug_report.yaml'},
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
mode: LaunchMode.externalApplication,
|
mode: LaunchMode.externalApplication,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue