Compare commits
4
Commits
v2
...
sgoedecke/testing
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
850c05ea4d | ||
|
|
701473dc11 | ||
|
|
786ceefcbc | ||
|
|
cb41259270 |
+2
-1
@@ -9,7 +9,8 @@ ACTIONS_STEP_DEBUG=true
|
|||||||
|
|
||||||
# GitHub Actions inputs should follow `INPUT_<name>` format (case-sensitive).
|
# GitHub Actions inputs should follow `INPUT_<name>` format (case-sensitive).
|
||||||
# Hyphens should not be converted to underscores!
|
# 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
|
# 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
|
# workflow and can be used in your actions. Setting the value here will override
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ inputs:
|
|||||||
model:
|
model:
|
||||||
description: The model to use
|
description: The model to use
|
||||||
required: false
|
required: false
|
||||||
default: 'gpt-4o'
|
default: 'openai/gpt-4o'
|
||||||
endpoint:
|
endpoint:
|
||||||
description: The endpoint to use
|
description: The endpoint to use
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="116" height="20" role="img" aria-label="Coverage: 89.47%"><title>Coverage: 89.47%</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="#dfb317"/><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">89.47%</text><text x="885" y="140" transform="scale(.1)" fill="#fff" textLength="430">89.47%</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 |
+12
-2
@@ -33584,7 +33584,13 @@ async function run() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (isUnexpected(response)) {
|
if (isUnexpected(response)) {
|
||||||
throw response.body.error;
|
if (response.body.error) {
|
||||||
|
throw response.body.error;
|
||||||
|
}
|
||||||
|
throw new Error('An error occurred while fetching the response (' +
|
||||||
|
response.status +
|
||||||
|
'): ' +
|
||||||
|
response.body);
|
||||||
}
|
}
|
||||||
const modelResponse = response.body.choices[0].message.content;
|
const modelResponse = response.body.choices[0].message.content;
|
||||||
// Set outputs for other workflow steps to use
|
// Set outputs for other workflow steps to use
|
||||||
@@ -33592,8 +33598,12 @@ async function run() {
|
|||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
// Fail the workflow run if an error occurs
|
// Fail the workflow run if an error occurs
|
||||||
if (error instanceof Error)
|
if (error instanceof Error) {
|
||||||
coreExports.setFailed(error.message);
|
coreExports.setFailed(error.message);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
coreExports.setFailed('An unexpected error occurred');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
+14
-3
@@ -43,9 +43,16 @@ export async function run(): Promise<void> {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (isUnexpected(response)) {
|
if (isUnexpected(response)) {
|
||||||
throw response.body.error
|
if (response.body.error) {
|
||||||
|
throw response.body.error
|
||||||
|
}
|
||||||
|
throw new Error(
|
||||||
|
'An error occurred while fetching the response (' +
|
||||||
|
response.status +
|
||||||
|
'): ' +
|
||||||
|
response.body
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const modelResponse: string | null =
|
const modelResponse: string | null =
|
||||||
response.body.choices[0].message.content
|
response.body.choices[0].message.content
|
||||||
|
|
||||||
@@ -53,6 +60,10 @@ export async function run(): Promise<void> {
|
|||||||
core.setOutput('response', modelResponse || '')
|
core.setOutput('response', modelResponse || '')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Fail the workflow run if an error occurs
|
// Fail the workflow run if an error occurs
|
||||||
if (error instanceof Error) core.setFailed(error.message)
|
if (error instanceof Error) {
|
||||||
|
core.setFailed(error.message)
|
||||||
|
} else {
|
||||||
|
core.setFailed('An unexpected error occurred')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user