generated from ubiquity-os/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds Github Action Support #6
Merged
0x4007
merged 11 commits into
ubiquity-os-marketplace:development
from
sshivaditya2019:development
Oct 22, 2024
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bfd968c
fix: added plugin action workflow
sshivaditya fd0bda0
fix: updated action
sshivaditya aa309dd
fix: updated compute.yml
sshivaditya a0c5ea5
fix: updated compute.yml
sshivaditya 4d9e674
fix: updated compute.yml
sshivaditya ae5f552
fix: comments and issues
sshivaditya c6873b1
fix: tests
sshivaditya 6e155e9
fix: changed to '.ts' in configuration.yml
sshivaditya bbfb34f
feat: updated compute.yml
sshivaditya 6660546
fix: compute.yml
sshivaditya d9cd798
fix: knip
sshivaditya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: "@ubiquity-os-marketplace/command-ask" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
stateId: | ||
description: "State Id" | ||
eventName: | ||
description: "Event Name" | ||
eventPayload: | ||
description: "Event Payload" | ||
settings: | ||
description: "Settings" | ||
authToken: | ||
description: "Auth Token" | ||
ref: | ||
description: "Ref" | ||
signature: | ||
description: "Signature sent from the Kernel" | ||
|
||
sshivaditya2019 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
jobs: | ||
compute: | ||
name: "LLM Reply" | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
env: | ||
SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | ||
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} | ||
VOYAGEAI_API_KEY: ${{secrets.VOYAGEAI_API_KEY}} | ||
sshivaditya2019 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}} | ||
UBIQUITY_OS_APP_NAME: ${{secrets.UBIQUITY_OS_APP_NAME}} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.10.0" | ||
|
||
- name: install dependencies | ||
run: yarn | ||
|
||
- name: execute directive | ||
run: npx tsx ./src/main.ts | ||
sshivaditya2019 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
id: command-ask | ||
env: | ||
SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | ||
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} | ||
VOYAGEAI_API_KEY: ${{secrets.VOYAGEAI_API_KEY}} | ||
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}} | ||
UBIQUITY_OS_APP_NAME: ${{secrets.UBIQUITY_OS_APP_NAME}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Update Manifest and Commit Changes | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
|
||
|
||
sshivaditya2019 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
jobs: | ||
update-manifest: | ||
name: "Update Manifest and Commit Changes" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Update Manifest and Commit Changes | ||
uses: ubiquity-os/action-deploy-plugin@main | ||
with: | ||
manifestPath: ${{ github.workspace }}/manifest.json | ||
schemaPath: ${{ github.workspace }}/src/types/plugin-input.ts | ||
pluginEntry: ${{ github.workspace }}/src/plugin.ts | ||
commitMessage: "chore: updated manifest.json and dist build" | ||
nodeVersion: "20.10.0" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import * as core from "@actions/core"; | ||
import * as github from "@actions/github"; | ||
import { Value } from "@sinclair/typebox/value"; | ||
import { envSchema } from "./types/env"; | ||
import { pluginSettingsSchema, PluginInputs, pluginSettingsValidator } from "./types"; | ||
import { plugin } from "./plugin"; | ||
|
||
/** | ||
* How a GitHub action executes the plugin. | ||
*/ | ||
export async function run() { | ||
const payload = github.context.payload.inputs; | ||
const env = Value.Decode(envSchema, process.env); | ||
const settings = Value.Decode(pluginSettingsSchema, Value.Default(pluginSettingsSchema, JSON.parse(payload.settings))); | ||
|
||
if (!pluginSettingsValidator.test(settings)) { | ||
throw new Error("Invalid settings provided"); | ||
} | ||
|
||
const inputs: PluginInputs = { | ||
stateId: payload.stateId, | ||
eventName: payload.eventName, | ||
eventPayload: JSON.parse(payload.eventPayload), | ||
settings, | ||
authToken: payload.authToken, | ||
ref: payload.ref, | ||
}; | ||
|
||
await plugin(inputs, env); | ||
} | ||
|
||
run() | ||
.then((result) => { | ||
core.setOutput("result", result); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
core.setFailed(error); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have an explanation it's unclear what this is