Skip to content

Commit 6cac571

Browse files
authored
Merge pull request #43 from dsanders11/feat/endpoint-input
Add input for endpoint
2 parents a230e1e + 675bfa2 commit 6cac571

File tree

6 files changed

+21
-14
lines changed

6 files changed

+21
-14
lines changed

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,17 @@ jobs:
4949

5050
### Configuration
5151

52-
| Input | Description | Default | Required |
53-
| ---------------------------- | ---------------------------------------------------------------------------------- | --------------------- | -------- |
54-
| `token` | GitHub token with issues and pull-requests permissions | `${{ github.token }}` | No |
55-
| `spam-label` | Label to add when generic spam is detected | `spam` | No |
56-
| `ai-label` | Label to add when AI-generated content is detected | `ai-generated` | No |
57-
| `minimize-detected-comments` | Whether to minimize comments detected as spam | `true` | No |
58-
| `custom-prompt-path` | Path to a custom YAML prompt file in your repository (relative to repository root) | (none) | No |
59-
| `enable-spam-detection` | Enable built-in spam detection prompt | `true` | No |
60-
| `enable-link-spam-detection` | Enable built-in link spam detection prompt | `true` | No |
61-
| `enable-ai-detection` | Enable built-in AI-generated content detection prompt | `true` | No |
52+
| Input | Description | Default | Required |
53+
| ---------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------ | -------- |
54+
| `token` | GitHub token with issues and pull-requests permissions | `${{ github.token }}` | No |
55+
| `spam-label` | Label to add when generic spam is detected | `spam` | No |
56+
| `ai-label` | Label to add when AI-generated content is detected | `ai-generated` | No |
57+
| `minimize-detected-comments` | Whether to minimize comments detected as spam | `true` | No |
58+
| `custom-prompt-path` | Path to a custom YAML prompt file in your repository (relative to repository root) | (none) | No |
59+
| `enable-spam-detection` | Enable built-in spam detection prompt | `true` | No |
60+
| `enable-link-spam-detection` | Enable built-in link spam detection prompt | `true` | No |
61+
| `enable-ai-detection` | Enable built-in AI-generated content detection prompt | `true` | No |
62+
| `endpoint` | The endpoint to use for inference | `https://models.github.ai/inference` | No |
6263

6364
## Inference
6465

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ inputs:
4343
description: 'Enable built-in AI-generated content detection prompt'
4444
required: false
4545
default: 'true'
46+
endpoint:
47+
description: The endpoint to use for inference
48+
required: false
49+
default: 'https://models.github.ai/inference'
4650

4751
runs:
4852
using: 'node16'

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ async function run(): Promise<void> {
1717
const aiLabel = core.getInput('ai-label')
1818
const minimizeComments = core.getBooleanInput('minimize-detected-comments')
1919
const customPromptPath = core.getInput('custom-prompt-path')
20+
const endpoint = core.getInput('endpoint')
2021

2122
// Built-in prompt configuration
2223
const enableSpamDetection = core.getBooleanInput('enable-spam-detection')
@@ -27,7 +28,7 @@ async function run(): Promise<void> {
2728

2829
const openai = new OpenAI({
2930
apiKey: token,
30-
baseURL: 'https://models.github.ai/inference'
31+
baseURL: endpoint
3132
})
3233
const octokit = github.getOctokit(token)
3334

0 commit comments

Comments
 (0)