Compare commits

..

4 Commits

Author SHA1 Message Date
Sean Goedecke 850c05ea4d dist 2025-04-07 22:52:09 +00:00
Sean Goedecke 701473dc11 use publisher 2025-04-07 22:43:25 +00:00
Sean Goedecke 786ceefcbc more logging 2025-04-07 22:31:16 +00:00
Sean Goedecke cb41259270 add logging 2025-04-07 22:26:14 +00:00
7 changed files with 16 additions and 42 deletions
+2 -1
View File
@@ -9,7 +9,8 @@ ACTIONS_STEP_DEBUG=true
# GitHub Actions inputs should follow `INPUT_<name>` format (case-sensitive).
# Hyphens should not be converted to underscores!
INPUT_PROMPT=hello
INPUT_prompt=hello
INPUT_token=
# GitHub Actions default environment variables. These are set for every run of a
# workflow and can be used in your actions. Setting the value here will override
+9 -17
View File
@@ -14,24 +14,16 @@ your actions.
Create a workflow to use the AI inference action:
```yaml
name: 'AI inference'
on: workflow_dispatch
steps:
- name: Test Local Action
id: inference
uses: actions/ai-inference@v1
with:
prompt: 'Hello!'
jobs:
inference:
permissions:
models: read
runs-on: ubuntu-latest
steps:
- name: Test Local Action
id: inference
uses: actions/ai-inference@v1
with:
prompt: 'Hello!'
- name: Print Output
id: output
run: echo "${{ steps.inference.outputs.response }}"
- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.response }}"
```
## Inputs
+1 -1
View File
@@ -4,7 +4,7 @@ author: 'GitHub'
# Add your action's branding here. This will appear on the GitHub Marketplace.
branding:
icon: 'message-square'
icon: 'play-circle'
color: red
# Define your inputs here.
+1 -1
View File
@@ -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

Generated Vendored
+1 -8
View File
@@ -33566,14 +33566,7 @@ async function run() {
if (token === undefined) {
throw new Error('GITHUB_TOKEN is not set');
}
let endpoint = coreExports.getInput('endpoint');
// If we're in an org-owned repository, we should use the org-owned endpoint
const repoOwner = process.env.GITHUB_REPOSITORY_OWNER;
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 endpoint = coreExports.getInput('endpoint');
const client = createClient(endpoint, new AzureKeyCredential(token));
const response = await client.path('/chat/completions').post({
body: {
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -13
View File
@@ -22,18 +22,7 @@ export async function run(): Promise<void> {
if (token === undefined) {
throw new Error('GITHUB_TOKEN is not set')
}
let endpoint = core.getInput('endpoint')
// If we're in an org-owned repository, we should use the org-owned endpoint
const repoOwner = process.env.GITHUB_REPOSITORY_OWNER
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 endpoint = core.getInput('endpoint')
const client = ModelClient(endpoint, new AzureKeyCredential(token))
@@ -64,7 +53,6 @@ export async function run(): Promise<void> {
response.body
)
}
const modelResponse: string | null =
response.body.choices[0].message.content