-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pompurin404
committed
Oct 23, 2024
1 parent
f8e359e
commit da56fe0
Showing
3 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## Auto Close Issue | ||
|
||
### Usage | ||
|
||
```yaml | ||
name: Auto Close Issue | ||
on: | ||
issues: | ||
types: [opened] | ||
|
||
jobs: | ||
auto_close_issue: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Auto Close Issue | ||
uses: mihomo-party-org/auto-close-issue@main | ||
with: | ||
title: ${{ github.event.issue.title }} | ||
body: ${{ github.event.issue.body }} | ||
number: ${{ github.event.issue.number }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
url: 'https://api.openai.com' | ||
key: 'sk-xxxxxx' | ||
prompt: 'xxxxxx' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: "Auto Close Issue" | ||
branding: | ||
icon: "check-circle" | ||
color: "black" | ||
description: "Review and automatically close issues through OpenAI" | ||
inputs: | ||
title: | ||
description: "Issue title" | ||
required: true | ||
default: ${{ github.event.issue.title }} | ||
body: | ||
description: "Issue body" | ||
required: true | ||
default: ${{ github.event.issue.body }} | ||
number: | ||
description: "Issue number" | ||
required: true | ||
default: ${{ github.event.issue.number }} | ||
token: | ||
description: "GitHub token" | ||
required: true | ||
default: ${{ secrets.GITHUB_TOKEN }} | ||
url: | ||
description: "OpenAI API Base URL" | ||
required: true | ||
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 they align with the selected options or checkboxes in the issue template, especially focusing on the "Verify steps" section. Finally give the evaluation result, whether the issue should be closed, whether the issue needs to be locked, and the reasons in Chinese. Consider all available information, not just the checkboxes. If there's not enough information to make a determination, state that in your response. If the content involves abusive or inappropriate language, please lock the issues | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: mihomo-party-org/auto-close-isssues | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.23" | ||
- run: go run main.go | ||
shell: bash | ||
env: | ||
ISSUE_TITLE: ${{ inputs.title }} | ||
ISSUE_BODY: ${{ inputs.body }} | ||
ISSUE_NUMBER: ${{ inputs.number }} | ||
GITHUB_TOKEN: ${{ inputs.token }} | ||
API_URL: ${{ inputs.url }} | ||
API_KEY: ${{ inputs.key }} | ||
SYSTEM_PROMPT: ${{ inputs.prompt }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters