-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
76 lines (75 loc) · 2.3 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: "Auto Close Issue"
branding:
icon: "check-circle"
color: "black"
description: "Review and automatically close issues through OpenAI"
inputs:
title:
description: "Issue title"
required: false
default: ${{ github.event.issue.title }}
body:
description: "Issue body"
required: false
default: ${{ github.event.issue.body }}
number:
description: "Issue number"
required: false
default: ${{ github.event.issue.number }}
repo:
description: "Repository"
required: false
default: ${{ github.repository }}
token:
description: "GitHub token"
required: false
app_id:
description: "GitHub Bot App ID"
required: false
private_key:
description: "GitHub Bot Private Key"
required: false
url:
description: "OpenAI API Base URL"
required: false
default: "https://api.openai.com"
key:
description: "OpenAI API Key"
required: true
prompt:
description: "OpenAI system prompt"
required: false
default: 'You are an AI assistant specialized in analyzing GitHub issues. Your task is to evaluate the title and body of a given issue and determine if it should be closed or lock. If you believe the issue should be closed, please provide a reason for your decision. The reply format is json, the example is: {"close":false,"lock":false,"content":"Close reason"}'
models:
description: "models"
required: false
default: "gpt-4o,gpt-4o-mini"
comment_model:
description: "comment model"
required: false
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
with:
repository: mihomo-party-org/auto-close-issue
- uses: actions/setup-go@v5
with:
go-version: "1.23"
- uses: tibdex/github-app-token@v2
if: ${{ inputs.app_id && inputs.private_key }}
id: generate-token
with:
app_id: ${{ inputs.app_id }}
private_key: ${{ inputs.private_key }}
- run: go run main.go
shell: bash
env:
ISSUE_TITLE: ${{ inputs.title }}
ISSUE_BODY: ${{ inputs.body }}
ISSUE_NUMBER: ${{ inputs.number }}
GITHUB_REPO: ${{ inputs.repo }}
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token || inputs.token }}
API_URL: ${{ inputs.url }}
API_KEY: ${{ inputs.key }}
SYSTEM_PROMPT: ${{ inputs.prompt }}