Merge branch 'main' into joshmgross/fix-readme
This commit is contained in:
2
.github/workflows/linter.yml
vendored
2
.github/workflows/linter.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Lint Codebase
|
- name: Lint Codebase
|
||||||
id: super-linter
|
id: super-linter
|
||||||
uses: super-linter/super-linter/slim@v7
|
uses: super-linter/super-linter/slim@4e8a7c2bf106c4c766c816b35ec612638dc9b6b2
|
||||||
env:
|
env:
|
||||||
DEFAULT_BRANCH: main
|
DEFAULT_BRANCH: main
|
||||||
FILTER_REGEX_EXCLUDE: dist/**/*
|
FILTER_REGEX_EXCLUDE: dist/**/*
|
||||||
|
|||||||
@@ -4,4 +4,4 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
# Default owners, unless a later match takes precedence.
|
# Default owners, unless a later match takes precedence.
|
||||||
* @actions/actions-oss-maintainers
|
* @actions/models
|
||||||
|
|||||||
@@ -96,6 +96,11 @@ following steps:
|
|||||||
to create a new release in GitHub so users can easily reference the new tags
|
to create a new release in GitHub so users can easily reference the new tags
|
||||||
in their workflows.
|
in their workflows.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This project is licensed under the terms of the MIT open source license. Please
|
||||||
|
refer to [MIT](./LICENSE.txt) for the full terms.
|
||||||
|
|
||||||
## Contributions
|
## Contributions
|
||||||
|
|
||||||
Contributions are welcome! See the [Contributor's Guide](CONTRIBUTING.md).
|
Contributions are welcome! See the [Contributor's Guide](CONTRIBUTING.md).
|
||||||
|
|||||||
39
SECURITY.md
Normal file
39
SECURITY.md
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# Security
|
||||||
|
|
||||||
|
GitHub takes the security of our software products and services seriously,
|
||||||
|
including all of the open source code repositories managed through our GitHub
|
||||||
|
organizations, such as [GitHub](https://github.com/GitHub).
|
||||||
|
|
||||||
|
Even though
|
||||||
|
[open source repositories are outside of the scope of our bug bounty program](https://bounty.github.com/index.html#scope)
|
||||||
|
and therefore not eligible for bounty rewards, we will ensure that your finding
|
||||||
|
gets passed along to the appropriate maintainers for remediation.
|
||||||
|
|
||||||
|
## Reporting Security Issues
|
||||||
|
|
||||||
|
If you believe you have found a security vulnerability in any GitHub-owned
|
||||||
|
repository, please report it to us through coordinated disclosure.
|
||||||
|
|
||||||
|
**Please do not report security vulnerabilities through public GitHub issues,
|
||||||
|
discussions, or pull requests.**
|
||||||
|
|
||||||
|
Instead, please send an email to opensource-security[@]github.com.
|
||||||
|
|
||||||
|
Please include as much of the information listed below as you can to help us
|
||||||
|
better understand and resolve the issue:
|
||||||
|
|
||||||
|
- The type of issue (e.g., buffer overflow, SQL injection, or cross-site
|
||||||
|
scripting)
|
||||||
|
- Full paths of source file(s) related to the manifestation of the issue
|
||||||
|
- The location of the affected source code (tag/branch/commit or direct URL)
|
||||||
|
- Any special configuration required to reproduce the issue
|
||||||
|
- Step-by-step instructions to reproduce the issue
|
||||||
|
- Proof-of-concept or exploit code (if possible)
|
||||||
|
- Impact of the issue, including how an attacker might exploit the issue
|
||||||
|
|
||||||
|
This information will help us triage your report more quickly.
|
||||||
|
|
||||||
|
## Policy
|
||||||
|
|
||||||
|
See
|
||||||
|
[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)
|
||||||
17
SUPPORT.md
Normal file
17
SUPPORT.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Support
|
||||||
|
|
||||||
|
## How to file issues and get help
|
||||||
|
|
||||||
|
This project uses GitHub issues to track bugs and feature requests. Please
|
||||||
|
search the existing issues before filing new issues to avoid duplicates. For new
|
||||||
|
issues, file your bug or feature request as a new issue.
|
||||||
|
|
||||||
|
For help or questions about using this project, please file an issue.
|
||||||
|
|
||||||
|
This project is under active development and maintained by GitHub staff and the
|
||||||
|
community. We will do our best to respond to support, feature requests, and
|
||||||
|
community questions in a timely manner.
|
||||||
|
|
||||||
|
## GitHub Support Policy
|
||||||
|
|
||||||
|
Support for this project is limited to the resources listed above.
|
||||||
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="116" height="20" role="img" aria-label="Coverage: 76.92%"><title>Coverage: 76.92%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="116" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="63" height="20" fill="#555"/><rect x="63" width="53" height="20" fill="#e05d44"/><rect width="116" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="325" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="530">Coverage</text><text x="325" y="140" transform="scale(.1)" fill="#fff" textLength="530">Coverage</text><text aria-hidden="true" x="885" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">76.92%</text><text x="885" y="140" transform="scale(.1)" fill="#fff" textLength="430">76.92%</text></g></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="116" height="20" role="img" aria-label="Coverage: 77.27%"><title>Coverage: 77.27%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="116" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="63" height="20" fill="#555"/><rect x="63" width="53" height="20" fill="#e05d44"/><rect width="116" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="325" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="530">Coverage</text><text x="325" y="140" transform="scale(.1)" fill="#fff" textLength="530">Coverage</text><text aria-hidden="true" x="885" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">77.27%</text><text x="885" y="140" transform="scale(.1)" fill="#fff" textLength="430">77.27%</text></g></svg>
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
15
dist/index.js
generated
vendored
15
dist/index.js
generated
vendored
@@ -33566,15 +33566,10 @@ async function run() {
|
|||||||
if (token === undefined) {
|
if (token === undefined) {
|
||||||
throw new Error('GITHUB_TOKEN is not set');
|
throw new Error('GITHUB_TOKEN is not set');
|
||||||
}
|
}
|
||||||
let endpoint = coreExports.getInput('endpoint');
|
const endpoint = coreExports.getInput('endpoint');
|
||||||
// If we're in an org-owned repository, we should use the org-owned endpoint
|
const client = createClient(endpoint, new AzureKeyCredential(token), {
|
||||||
const repoOwner = process.env.GITHUB_REPOSITORY_OWNER;
|
userAgentOptions: { userAgentPrefix: 'github-actions-ai-inference' }
|
||||||
const ownerType = process.env.GITHUB_REPOSITORY_OWNER_TYPE;
|
});
|
||||||
if (endpoint == 'https://models.github.ai/inference' &&
|
|
||||||
ownerType == 'Organization') {
|
|
||||||
endpoint = `https://models.github.ai/${repoOwner}/inference`;
|
|
||||||
}
|
|
||||||
const client = createClient(endpoint, new AzureKeyCredential(token));
|
|
||||||
const response = await client.path('/chat/completions').post({
|
const response = await client.path('/chat/completions').post({
|
||||||
body: {
|
body: {
|
||||||
messages: [
|
messages: [
|
||||||
@@ -33584,8 +33579,6 @@ async function run() {
|
|||||||
},
|
},
|
||||||
{ role: 'user', content: prompt }
|
{ role: 'user', content: prompt }
|
||||||
],
|
],
|
||||||
temperature: 1.0,
|
|
||||||
top_p: 1.0,
|
|
||||||
max_tokens: maxTokens,
|
max_tokens: maxTokens,
|
||||||
model: modelName
|
model: modelName
|
||||||
}
|
}
|
||||||
|
|||||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
32
package-lock.json
generated
32
package-lock.json
generated
@@ -9,13 +9,12 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1"
|
||||||
"@rollup/rollup-linux-x64-gnu": "*"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@azure-rest/ai-inference": "*",
|
"@azure-rest/ai-inference": "latest",
|
||||||
"@azure/core-auth": "*",
|
"@azure/core-auth": "latest",
|
||||||
"@azure/core-sse": "*",
|
"@azure/core-sse": "latest",
|
||||||
"@eslint/compat": "^1.2.7",
|
"@eslint/compat": "^1.2.7",
|
||||||
"@github/local-action": "^3.1.3",
|
"@github/local-action": "^3.1.3",
|
||||||
"@jest/globals": "^29.7.0",
|
"@jest/globals": "^29.7.0",
|
||||||
@@ -1735,9 +1734,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@github/local-action": {
|
"node_modules/@github/local-action": {
|
||||||
"version": "3.1.3",
|
"version": "3.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/@github/local-action/-/local-action-3.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@github/local-action/-/local-action-3.1.4.tgz",
|
||||||
"integrity": "sha512-Pi2Mf7bIiFN30xgDtaQf0Yvm2fZ1QnMGZmNHAKimW/ntCLFVJQsWXmNo3GqzsENbyXcsb2ziZ6DJI5b9TmWYig==",
|
"integrity": "sha512-PwA4w5jsjbyK+DNFNnFc4htu0iBOngi8g+O7NV8eGo9wm5YpIxf9kKgLJgVDIZlT32rfOVre5XZzGdPLTfggHQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -1751,6 +1750,7 @@
|
|||||||
"@octokit/plugin-request-log": "^5.3.1",
|
"@octokit/plugin-request-log": "^5.3.1",
|
||||||
"@octokit/plugin-rest-endpoint-methods": "^13.3.1",
|
"@octokit/plugin-rest-endpoint-methods": "^13.3.1",
|
||||||
"@octokit/plugin-retry": "^7.1.2",
|
"@octokit/plugin-retry": "^7.1.2",
|
||||||
|
"@octokit/rest": "^21.1.1",
|
||||||
"archiver": "^7.0.1",
|
"archiver": "^7.0.1",
|
||||||
"chalk": "^5.3.0",
|
"chalk": "^5.3.0",
|
||||||
"commander": "^13.0.0",
|
"commander": "^13.0.0",
|
||||||
@@ -2662,6 +2662,22 @@
|
|||||||
"node": ">= 18"
|
"node": ">= 18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@octokit/rest": {
|
||||||
|
"version": "21.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-21.1.1.tgz",
|
||||||
|
"integrity": "sha512-sTQV7va0IUVZcntzy1q3QqPm/r8rWtDCqpRAmb8eXXnKkjoQEtFe3Nt5GTVsHft+R6jJoHeSiVLcgcvhtue/rg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/core": "^6.1.4",
|
||||||
|
"@octokit/plugin-paginate-rest": "^11.4.2",
|
||||||
|
"@octokit/plugin-request-log": "^5.3.1",
|
||||||
|
"@octokit/plugin-rest-endpoint-methods": "^13.3.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 18"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@octokit/types": {
|
"node_modules/@octokit/types": {
|
||||||
"version": "13.8.0",
|
"version": "13.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.8.0.tgz",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "typescript-action",
|
"name": "typescript-action",
|
||||||
"description": "GitHub Actions TypeScript template",
|
"description": "GitHub Actions TypeScript template",
|
||||||
"version": "0.0.0",
|
"version": "1.0.0",
|
||||||
"author": "",
|
"author": "",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
18
src/main.ts
18
src/main.ts
@@ -23,19 +23,11 @@ export async function run(): Promise<void> {
|
|||||||
throw new Error('GITHUB_TOKEN is not set')
|
throw new Error('GITHUB_TOKEN is not set')
|
||||||
}
|
}
|
||||||
|
|
||||||
let endpoint = core.getInput('endpoint')
|
const endpoint = core.getInput('endpoint')
|
||||||
|
|
||||||
// If we're in an org-owned repository, we should use the org-owned endpoint
|
const client = ModelClient(endpoint, new AzureKeyCredential(token), {
|
||||||
const repoOwner = process.env.GITHUB_REPOSITORY_OWNER
|
userAgentOptions: { userAgentPrefix: 'github-actions-ai-inference' }
|
||||||
const ownerType = process.env.GITHUB_REPOSITORY_OWNER_TYPE
|
})
|
||||||
if (
|
|
||||||
endpoint == 'https://models.github.ai/inference' &&
|
|
||||||
ownerType == 'Organization'
|
|
||||||
) {
|
|
||||||
endpoint = `https://models.github.ai/${repoOwner}/inference`
|
|
||||||
}
|
|
||||||
|
|
||||||
const client = ModelClient(endpoint, new AzureKeyCredential(token))
|
|
||||||
|
|
||||||
const response = await client.path('/chat/completions').post({
|
const response = await client.path('/chat/completions').post({
|
||||||
body: {
|
body: {
|
||||||
@@ -46,8 +38,6 @@ export async function run(): Promise<void> {
|
|||||||
},
|
},
|
||||||
{ role: 'user', content: prompt }
|
{ role: 'user', content: prompt }
|
||||||
],
|
],
|
||||||
temperature: 1.0,
|
|
||||||
top_p: 1.0,
|
|
||||||
max_tokens: maxTokens,
|
max_tokens: maxTokens,
|
||||||
model: modelName
|
model: modelName
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user