fix: corrected payload argument
This commit is contained in:
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -2,10 +2,6 @@ name: 'Unit Tests'
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
issue_comment:
|
|
||||||
types:
|
|
||||||
- created
|
|
||||||
- edited
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
11
dist/index.js
vendored
11
dist/index.js
vendored
@@ -32842,14 +32842,15 @@ const route = core.getInput("route") || "agent-lake";
|
|||||||
const method = core.getInput("method") || "embeddings_insert";
|
const method = core.getInput("method") || "embeddings_insert";
|
||||||
const debug = (core.getInput("debug") || "false").toLowerCase() === "true";
|
const debug = (core.getInput("debug") || "false").toLowerCase() === "true";
|
||||||
|
|
||||||
|
const payload = github.context.payload;
|
||||||
const githubToken = process.env.GITHUB_TOKEN;
|
const githubToken = process.env.GITHUB_TOKEN;
|
||||||
const commentBody = payload?.comment?.body || "";
|
const commentBody = payload?.comment?.body || "";
|
||||||
const issueNumber = payload?.issue?.number;
|
const issueNumber = payload?.issue?.number || 1;
|
||||||
const repoFull = process.env.GITHUB_REPOSITORY;
|
const repoFullName = process.env.GITHUB_REPOSITORY;
|
||||||
|
|
||||||
const [owner, repo] = repoFull.split("/");
|
const [owner, repo] = repoFullName.split("/");
|
||||||
const segment_id = internal.examples.code;
|
const segment_id = "internal.examples.code";
|
||||||
const document_id = [owner, repo, issueNumber].join(".");
|
const document_id = [owner, repo, String(issueNumber)].join(".");
|
||||||
|
|
||||||
const serverUrl = (
|
const serverUrl = (
|
||||||
process.env.GITHUB_SERVER_URL ||
|
process.env.GITHUB_SERVER_URL ||
|
||||||
|
|||||||
7
index.js
7
index.js
@@ -10,13 +10,14 @@ const route = core.getInput("route") || "agent-lake";
|
|||||||
const method = core.getInput("method") || "embeddings_insert";
|
const method = core.getInput("method") || "embeddings_insert";
|
||||||
const debug = (core.getInput("debug") || "false").toLowerCase() === "true";
|
const debug = (core.getInput("debug") || "false").toLowerCase() === "true";
|
||||||
|
|
||||||
|
const payload = github.context.payload;
|
||||||
const githubToken = process.env.GITHUB_TOKEN;
|
const githubToken = process.env.GITHUB_TOKEN;
|
||||||
const commentBody = payload?.comment?.body || "";
|
const commentBody = payload?.comment?.body || "";
|
||||||
const issueNumber = payload?.issue?.number || 1;
|
const issueNumber = payload?.issue?.number || 1;
|
||||||
const repoFull = process.env.GITHUB_REPOSITORY;
|
const repoFullName = process.env.GITHUB_REPOSITORY;
|
||||||
|
|
||||||
const [owner, repo] = repoFull.split("/");
|
const [owner, repo] = repoFullName.split("/");
|
||||||
const segment_id = internal.examples.code;
|
const segment_id = "internal.examples.code";
|
||||||
const document_id = [owner, repo, String(issueNumber)].join(".");
|
const document_id = [owner, repo, String(issueNumber)].join(".");
|
||||||
|
|
||||||
const serverUrl = (
|
const serverUrl = (
|
||||||
|
|||||||
Reference in New Issue
Block a user