Compare commits
1 Commits
803404942b
...
3f35b97e15
| Author | SHA1 | Date | |
|---|---|---|---|
|
3f35b97e15
|
4
.github/workflows/agent-markdown.yml
vendored
4
.github/workflows/agent-markdown.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
- name: Send task to coding agent
|
||||
uses: https://git.yusufali.ca/actions/embed-markdown@main
|
||||
with:
|
||||
api_url: ${{ secrets.AGENT_API_URL }} # default: https://api.servc.io
|
||||
api_url: ${{ secrets.AGENT_API_URL }} # default: http://agent-api.k8s.private
|
||||
api_token: ${{ secrets.AGENT_TOKEN }} # optional, required for authenticated API calls
|
||||
route: agent-lake # default: agent-lake
|
||||
debug: false
|
||||
debug: false
|
||||
|
||||
13
.github/workflows/test.yml
vendored
13
.github/workflows/test.yml
vendored
@@ -13,8 +13,13 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Test Local Action
|
||||
id: test
|
||||
uses: ./
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
debug: 'true'
|
||||
node-version: 20
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run unit tests
|
||||
run: npm test
|
||||
|
||||
@@ -22,9 +22,8 @@ jobs:
|
||||
- name: Send task to coding agent
|
||||
uses: https://git.yusufali.ca/actions/embed-markdown@main
|
||||
with:
|
||||
api_url: ${{ secrets.AGENT_API_URL }} # default: https://api.servc.io
|
||||
api_url: ${{ secrets.AGENT_API_URL }} # default: http://agent-api.k8s.private
|
||||
api_token: ${{ secrets.AGENT_TOKEN }} # optional, required for authenticated API calls
|
||||
route: agent-lake # default: agent-lake
|
||||
debug: false
|
||||
```
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ description: 'Sends markdown files to the lake to embed into vector form'
|
||||
inputs:
|
||||
api_url:
|
||||
description: 'api url'
|
||||
default: 'http://agents-api.servc-agents:3000'
|
||||
default: 'http://agent-api.k8s.private'
|
||||
required: false
|
||||
api_token:
|
||||
description: 'API token for authentication'
|
||||
|
||||
2
dist/index.js
vendored
2
dist/index.js
vendored
@@ -24,7 +24,7 @@ function getConfig({
|
||||
env = process.env,
|
||||
} = {}) {
|
||||
const apiUrl =
|
||||
coreModule.getInput("api_url") || "http://agents-api.servc-agents:3000";
|
||||
coreModule.getInput("api_url") || "http://agent-api.k8s.private";
|
||||
const apiToken = coreModule.getInput("api_token");
|
||||
const route = coreModule.getInput("route") || "agent-lake";
|
||||
const method = coreModule.getInput("method") || "embeddings_insert";
|
||||
|
||||
2
index.js
2
index.js
@@ -18,7 +18,7 @@ function getConfig({
|
||||
env = process.env,
|
||||
} = {}) {
|
||||
const apiUrl =
|
||||
coreModule.getInput("api_url") || "http://agents-api.servc-agents:3000";
|
||||
coreModule.getInput("api_url") || "http://agent-api.k8s.private";
|
||||
const apiToken = coreModule.getInput("api_token");
|
||||
const route = coreModule.getInput("route") || "agent-lake";
|
||||
const method = coreModule.getInput("method") || "embeddings_insert";
|
||||
|
||||
@@ -1,7 +1,32 @@
|
||||
const test = require("node:test");
|
||||
const assert = require("node:assert/strict");
|
||||
|
||||
const { buildRequestPayload, main, sanitizeDocumentId } = require("./index");
|
||||
const {
|
||||
buildRequestPayload,
|
||||
getConfig,
|
||||
main,
|
||||
sanitizeDocumentId,
|
||||
} = require("./index");
|
||||
|
||||
test("getConfig defaults to the ingress API URL", () => {
|
||||
const config = getConfig({
|
||||
coreModule: {
|
||||
getInput() {
|
||||
return "";
|
||||
},
|
||||
},
|
||||
githubModule: {
|
||||
context: {
|
||||
serverUrl: "https://github.example",
|
||||
},
|
||||
},
|
||||
env: {},
|
||||
});
|
||||
|
||||
assert.equal(config.apiUrl, "http://agent-api.k8s.private");
|
||||
assert.equal(config.route, "agent-lake");
|
||||
assert.equal(config.method, "embeddings_insert");
|
||||
});
|
||||
|
||||
test("sanitizeDocumentId removes special characters and preserves periods", () => {
|
||||
assert.equal(
|
||||
|
||||
Reference in New Issue
Block a user