diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f36abb7..69a0f7f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,10 +2,6 @@ name: 'Unit Tests' on: pull_request: workflow_dispatch: - issue_comment: - types: - - created - - edited permissions: contents: read diff --git a/dist/index.js b/dist/index.js index 5657005..ee276d6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -32842,14 +32842,15 @@ const route = core.getInput("route") || "agent-lake"; const method = core.getInput("method") || "embeddings_insert"; const debug = (core.getInput("debug") || "false").toLowerCase() === "true"; +const payload = github.context.payload; const githubToken = process.env.GITHUB_TOKEN; const commentBody = payload?.comment?.body || ""; -const issueNumber = payload?.issue?.number; -const repoFull = process.env.GITHUB_REPOSITORY; +const issueNumber = payload?.issue?.number || 1; +const repoFullName = process.env.GITHUB_REPOSITORY; -const [owner, repo] = repoFull.split("/"); -const segment_id = internal.examples.code; -const document_id = [owner, repo, issueNumber].join("."); +const [owner, repo] = repoFullName.split("/"); +const segment_id = "internal.examples.code"; +const document_id = [owner, repo, String(issueNumber)].join("."); const serverUrl = ( process.env.GITHUB_SERVER_URL || diff --git a/index.js b/index.js index afc92ef..b5e3eb7 100644 --- a/index.js +++ b/index.js @@ -10,13 +10,14 @@ const route = core.getInput("route") || "agent-lake"; const method = core.getInput("method") || "embeddings_insert"; const debug = (core.getInput("debug") || "false").toLowerCase() === "true"; +const payload = github.context.payload; const githubToken = process.env.GITHUB_TOKEN; const commentBody = payload?.comment?.body || ""; const issueNumber = payload?.issue?.number || 1; -const repoFull = process.env.GITHUB_REPOSITORY; +const repoFullName = process.env.GITHUB_REPOSITORY; -const [owner, repo] = repoFull.split("/"); -const segment_id = internal.examples.code; +const [owner, repo] = repoFullName.split("/"); +const segment_id = "internal.examples.code"; const document_id = [owner, repo, String(issueNumber)].join("."); const serverUrl = (