Skip to content

Commit e8a0beb

Browse files
authored
Merge pull request #9 from actions/sgoedecke/use-user-provided-endpoint
Use user-provided endpoint
2 parents 83d9668 + ba8a6b0 commit e8a0beb

File tree

6 files changed

+66
-27
lines changed

6 files changed

+66
-27
lines changed

SECURITY.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Security
2+
3+
GitHub takes the security of our software products and services seriously,
4+
including all of the open source code repositories managed through our GitHub
5+
organizations, such as [GitHub](https://github.com/GitHub).
6+
7+
Even though
8+
[open source repositories are outside of the scope of our bug bounty program](https://bounty.github.com/index.html#scope)
9+
and therefore not eligible for bounty rewards, we will ensure that your finding
10+
gets passed along to the appropriate maintainers for remediation.
11+
12+
## Reporting Security Issues
13+
14+
If you believe you have found a security vulnerability in any GitHub-owned
15+
repository, please report it to us through coordinated disclosure.
16+
17+
**Please do not report security vulnerabilities through public GitHub issues,
18+
discussions, or pull requests.**
19+
20+
Instead, please send an email to opensource-security[@]github.com.
21+
22+
Please include as much of the information listed below as you can to help us
23+
better understand and resolve the issue:
24+
25+
- The type of issue (e.g., buffer overflow, SQL injection, or cross-site
26+
scripting)
27+
- Full paths of source file(s) related to the manifestation of the issue
28+
- The location of the affected source code (tag/branch/commit or direct URL)
29+
- Any special configuration required to reproduce the issue
30+
- Step-by-step instructions to reproduce the issue
31+
- Proof-of-concept or exploit code (if possible)
32+
- Impact of the issue, including how an attacker might exploit the issue
33+
34+
This information will help us triage your report more quickly.
35+
36+
## Policy
37+
38+
See
39+
[GitHub's Safe Harbor Policy](https://docs.github.com/en/site-policy/security-policies/github-bug-bounty-program-legal-safe-harbor#1-safe-harbor-terms)

SUPPORT.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Support
2+
3+
## How to file issues and get help
4+
5+
This project uses GitHub issues to track bugs and feature requests. Please
6+
search the existing issues before filing new issues to avoid duplicates. For new
7+
issues, file your bug or feature request as a new issue.
8+
9+
For help or questions about using this project, please file an issue.
10+
11+
This project is under active development and maintained by GitHub staff and the
12+
community. We will do our best to respond to support, feature requests, and
13+
community questions in a timely manner.
14+
15+
## GitHub Support Policy
16+
17+
Support for this project is limited to the resources listed above.

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

Lines changed: 4 additions & 11 deletions
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/main.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,11 @@ export async function run(): Promise<void> {
2323
throw new Error('GITHUB_TOKEN is not set')
2424
}
2525

26-
let endpoint = core.getInput('endpoint')
26+
const endpoint = core.getInput('endpoint')
2727

28-
// If we're in an org-owned repository, we should use the org-owned endpoint
29-
const repoOwner = process.env.GITHUB_REPOSITORY_OWNER
30-
const ownerType = process.env.GITHUB_REPOSITORY_OWNER_TYPE
31-
if (
32-
endpoint == 'https://models.github.ai/inference' &&
33-
ownerType == 'Organization'
34-
) {
35-
endpoint = `https://models.github.ai/${repoOwner}/inference`
36-
}
37-
38-
const client = ModelClient(endpoint, new AzureKeyCredential(token))
28+
const client = ModelClient(endpoint, new AzureKeyCredential(token), {
29+
userAgentOptions: { userAgentPrefix: 'github-actions-ai-inference' }
30+
})
3931

4032
const response = await client.path('/chat/completions').post({
4133
body: {
@@ -46,8 +38,6 @@ export async function run(): Promise<void> {
4638
},
4739
{ role: 'user', content: prompt }
4840
],
49-
temperature: 1.0,
50-
top_p: 1.0,
5141
max_tokens: maxTokens,
5242
model: modelName
5343
}

0 commit comments

Comments
 (0)