Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/sim/lib/internal/github/execute-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export const executeGitHubTool: InternalToolOperationHandler = async (request) =
try {
switch (request.toolId) {
case 'github_comment':
return await executeToolOperationImplementation(executeGitHubCommentOperation, request)
return executeToolOperationImplementation(executeGitHubCommentOperation, request)
case 'github_comment_v2':
return await executeToolOperationImplementation(executeGitHubCommentV2Operation, request)
return executeToolOperationImplementation(executeGitHubCommentV2Operation, request)
Comment on lines +25 to +27

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Expired tokens stop comments

Removing await makes rejected comment operations skip this catch. executeToolOperationImplementation lets errors pass through, including a GitHubOperationError when GitHub returns 401. The caller refreshes credentials only when this handler returns a 401 Response, so an expired token now fails the comment instead of refreshing and retrying.

Keep return await in both comment cases so failures reach the existing error response.

Suggested change
return executeToolOperationImplementation(executeGitHubCommentOperation, request)
case 'github_comment_v2':
return await executeToolOperationImplementation(executeGitHubCommentV2Operation, request)
return executeToolOperationImplementation(executeGitHubCommentV2Operation, request)
return await executeToolOperationImplementation(executeGitHubCommentOperation, request)
case 'github_comment_v2':
return await executeToolOperationImplementation(executeGitHubCommentV2Operation, request)

case 'github_latest_commit':
case 'github_latest_commit_v2': {
const parsed = inputSchema.safeParse(request.input)
Expand Down
25 changes: 5 additions & 20 deletions apps/sim/lib/internal/github/operations.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createLogger } from '@sim/logger'
import { getErrorMessage } from '@sim/utils/errors'
import { isRecordLike } from '@sim/utils/object'
import {
secureFetchWithPinnedIP,
Expand All @@ -12,7 +11,6 @@ import {
} from '@/lib/core/utils/stream-limits'
import { GitHubOperationError } from '@/lib/internal/github/errors'
import { MAX_BUFFERED_TRANSFER_BYTES } from '@/lib/uploads/shared/types'
import { githubPathSegment, githubRepoPath } from '@/tools/github/request-path'
import { formatGitHubErrorMessage } from '@/tools/github/response-parsers'
import type {
CreateCommentParams,
Expand All @@ -21,7 +19,6 @@ import type {
} from '@/tools/github/types'
import { secureGitHubRequest } from '@/tools/github/utils.server'
import type { ToolResponse } from '@/tools/types'
import { safeUrlPathSegment } from '@/tools/url-path'

const logger = createLogger('GitHubLatestCommitOperation')
const MAX_COMMIT_RESPONSE_BYTES = 10 * 1024 * 1024
Expand Down Expand Up @@ -126,20 +123,8 @@ function githubHeaders(apiKey: string): Record<string, string> {
}
}

/** Builds a request path from caller input, reporting a rejected segment as a 400. */
function buildRequestPath(build: () => string): string {
try {
return build()
} catch (error) {
throw new GitHubOperationError(getErrorMessage(error, 'Invalid GitHub request path'), 400)
}
}

function pullRequestUrl(params: CreateCommentParams): string {
return buildRequestPath(
() =>
`${GITHUB_API_BASE}/repos/${githubRepoPath(params.owner, params.repo)}/pulls/${githubPathSegment(params.pullNumber, 'pullNumber')}`
)
return `${GITHUB_API_BASE}/repos/${params.owner}/${params.repo}/pulls/${params.pullNumber}`
}

function isFileCommentRequest(params: CreateCommentParams): boolean {
Expand Down Expand Up @@ -415,10 +400,10 @@ export async function getGitHubLatestCommit(
context: GitHubOperationContext
): Promise<LatestCommitResponse> {
context.signal?.throwIfAborted()
const commitUrl = buildRequestPath(
() =>
`${GITHUB_API_BASE}/repos/${githubRepoPath(input.owner, input.repo)}/commits/${safeUrlPathSegment(input.branch || 'HEAD', 'branch', { allowSeparators: true })}`
)
const owner = encodeURIComponent(input.owner)
const repo = encodeURIComponent(input.repo)
const revision = encodeURIComponent(input.branch || 'HEAD')
const commitUrl = `https://api.github.com/repos/${owner}/${repo}/commits/${revision}`
const validation = await validateUrlWithDNS(commitUrl, 'commitUrl', 'configuredEndpoint')
context.signal?.throwIfAborted()
if (!validation.isValid) {
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/add_assignees.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubPathSegment, githubRepoPath } from '@/tools/github/request-path'
import type { AddAssigneesParams, IssueResponse } from '@/tools/github/types'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
Expand Down Expand Up @@ -45,7 +44,7 @@ export const addAssigneesTool: ToolConfig<AddAssigneesParams, IssueResponse> = {

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/issues/${githubPathSegment(params.issue_number, 'issue_number')}/assignees`,
`https://api.github.com/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/assignees`,
method: 'POST',
headers: (params) => ({
Accept: 'application/vnd.github.v3+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/add_labels.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubPathSegment, githubRepoPath } from '@/tools/github/request-path'
import type { AddLabelsParams, LabelsResponse } from '@/tools/github/types'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
Expand Down Expand Up @@ -45,7 +44,7 @@ export const addLabelsTool: ToolConfig<AddLabelsParams, LabelsResponse> = {

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/issues/${githubPathSegment(params.issue_number, 'issue_number')}/labels`,
`https://api.github.com/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/labels`,
method: 'POST',
headers: (params) => ({
Accept: 'application/vnd.github.v3+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/cancel_workflow_run.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubPathSegment, githubRepoPath } from '@/tools/github/request-path'
import type { CancelWorkflowRunParams, CancelWorkflowRunResponse } from '@/tools/github/types'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
Expand Down Expand Up @@ -41,7 +40,7 @@ export const cancelWorkflowRunTool: ToolConfig<CancelWorkflowRunParams, CancelWo

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/actions/runs/${githubPathSegment(params.run_id, 'run_id')}/cancel`,
`https://api.github.com/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/cancel`,
method: 'POST',
headers: (params) => ({
Accept: 'application/vnd.github+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/close_issue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubPathSegment, githubRepoPath } from '@/tools/github/request-path'
import type { CloseIssueParams, IssueResponse } from '@/tools/github/types'
import { ISSUE_OUTPUT_PROPERTIES, LABEL_OUTPUT, USER_OUTPUT } from '@/tools/github/types'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
Expand Down Expand Up @@ -46,7 +45,7 @@ export const closeIssueTool: ToolConfig<CloseIssueParams, IssueResponse> = {

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/issues/${githubPathSegment(params.issue_number, 'issue_number')}`,
`https://api.github.com/repos/${params.owner}/${params.repo}/issues/${params.issue_number}`,
method: 'PATCH',
headers: (params) => ({
Accept: 'application/vnd.github.v3+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/close_pr.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubPathSegment, githubRepoPath } from '@/tools/github/request-path'
import type { ClosePRParams, PRResponse } from '@/tools/github/types'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
Expand Down Expand Up @@ -39,7 +38,7 @@ export const closePRTool: ToolConfig<ClosePRParams, PRResponse> = {

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/pulls/${githubPathSegment(params.pullNumber, 'pullNumber')}`,
`https://api.github.com/repos/${params.owner}/${params.repo}/pulls/${params.pullNumber}`,
method: 'PATCH',
headers: (params) => ({
Accept: 'application/vnd.github.v3+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/compare_commits.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubRefPath, githubRepoPath } from '@/tools/github/request-path'
import {
COMMIT_DATA_OUTPUT,
COMMIT_FILE_OUTPUT_PROPERTIES,
Expand Down Expand Up @@ -106,7 +105,7 @@ export const compareCommitsTool: ToolConfig<CompareCommitsParams, CompareCommits
request: {
url: (params) => {
const url = new URL(
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/compare/${githubRefPath(params.base, 'base')}...${githubRefPath(params.head, 'head')}`
`https://api.github.com/repos/${params.owner}/${params.repo}/compare/${params.base}...${params.head}`
)
if (params.per_page) url.searchParams.append('per_page', String(params.per_page))
if (params.page) url.searchParams.append('page', String(params.page))
Expand Down
4 changes: 1 addition & 3 deletions apps/sim/tools/github/create_branch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubRepoPath } from '@/tools/github/request-path'
import type { CreateBranchParams, RefResponse } from '@/tools/github/types'
import { GIT_REF_OUTPUT_PROPERTIES } from '@/tools/github/types'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
Expand Down Expand Up @@ -46,8 +45,7 @@ export const createBranchTool: ToolConfig<CreateBranchParams, RefResponse> = {
},

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/git/refs`,
url: (params) => `https://api.github.com/repos/${params.owner}/${params.repo}/git/refs`,
method: 'POST',
headers: (params) => ({
Accept: 'application/vnd.github+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/create_comment_reaction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubPathSegment, githubRepoPath } from '@/tools/github/request-path'
import { REACTION_OUTPUT_PROPERTIES, USER_OUTPUT } from '@/tools/github/types'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
Expand Down Expand Up @@ -70,7 +69,7 @@ export const createCommentReactionTool: ToolConfig<

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/issues/comments/${githubPathSegment(params.comment_id, 'comment_id')}/reactions`,
`https://api.github.com/repos/${params.owner}/${params.repo}/issues/comments/${params.comment_id}/reactions`,
method: 'POST',
headers: (params) => ({
Accept: 'application/vnd.github.squirrel-girl-preview+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/create_file.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { encodeContentPath } from '@/tools/github/content-path'
import { githubRepoPath } from '@/tools/github/request-path'
import type { CreateFileParams, FileOperationResponse } from '@/tools/github/types'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
Expand Down Expand Up @@ -59,7 +58,7 @@ export const createFileTool: ToolConfig<CreateFileParams, FileOperationResponse>

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/contents/${encodeContentPath(params.path)}`,
`https://api.github.com/repos/${params.owner}/${params.repo}/contents/${encodeContentPath(params.path)}`,
method: 'PUT',
headers: (params) => ({
Accept: 'application/vnd.github+json',
Expand Down
4 changes: 1 addition & 3 deletions apps/sim/tools/github/create_issue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubRepoPath } from '@/tools/github/request-path'
import type { CreateIssueParams, IssueResponse } from '@/tools/github/types'
import {
ISSUE_OUTPUT_PROPERTIES,
Expand Down Expand Up @@ -68,8 +67,7 @@ export const createIssueTool: ToolConfig<CreateIssueParams, IssueResponse> = {
},

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/issues`,
url: (params) => `https://api.github.com/repos/${params.owner}/${params.repo}/issues`,
method: 'POST',
headers: (params) => ({
Accept: 'application/vnd.github.v3+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/create_issue_reaction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubPathSegment, githubRepoPath } from '@/tools/github/request-path'
import { REACTION_OUTPUT_PROPERTIES, USER_OUTPUT } from '@/tools/github/types'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
Expand Down Expand Up @@ -70,7 +69,7 @@ export const createIssueReactionTool: ToolConfig<

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/issues/${githubPathSegment(params.issue_number, 'issue_number')}/reactions`,
`https://api.github.com/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/reactions`,
method: 'POST',
headers: (params) => ({
Accept: 'application/vnd.github.squirrel-girl-preview+json',
Expand Down
4 changes: 1 addition & 3 deletions apps/sim/tools/github/create_milestone.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubRepoPath } from '@/tools/github/request-path'
import { MILESTONE_CREATOR_OUTPUT, MILESTONE_V2_OUTPUT_PROPERTIES } from '@/tools/github/types'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
Expand Down Expand Up @@ -86,8 +85,7 @@ export const createMilestoneTool: ToolConfig<CreateMilestoneParams, CreateMilest
},

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/milestones`,
url: (params) => `https://api.github.com/repos/${params.owner}/${params.repo}/milestones`,
method: 'POST',
headers: (params) => ({
Accept: 'application/vnd.github.v3+json',
Expand Down
4 changes: 1 addition & 3 deletions apps/sim/tools/github/create_pr.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubRepoPath } from '@/tools/github/request-path'
import type { CreatePRParams, PRResponse } from '@/tools/github/types'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
Expand Down Expand Up @@ -62,8 +61,7 @@ export const createPRTool: ToolConfig<CreatePRParams, PRResponse> = {
},

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/pulls`,
url: (params) => `https://api.github.com/repos/${params.owner}/${params.repo}/pulls`,
method: 'POST',
headers: (params) => ({
Accept: 'application/vnd.github.v3+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/create_pr_review.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { isRecordLike } from '@sim/utils/object'
import { githubPathSegment, githubRepoPath } from '@/tools/github/request-path'
import {
nullableNonEmptyString,
optionalNonEmptyString,
Expand Down Expand Up @@ -162,7 +161,7 @@ export const createPRReviewTool: ToolConfig<CreatePRReviewParams, PRReviewRespon

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/pulls/${githubPathSegment(params.pullNumber, 'pullNumber')}/reviews`,
`https://api.github.com/repos/${params.owner}/${params.repo}/pulls/${params.pullNumber}/reviews`,
method: 'POST',
headers: (params) => ({
Accept: 'application/vnd.github+json',
Expand Down
4 changes: 1 addition & 3 deletions apps/sim/tools/github/create_release.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubRepoPath } from '@/tools/github/request-path'
import type { CreateReleaseParams, ReleaseResponse } from '@/tools/github/types'
import {
RELEASE_ASSET_OUTPUT_PROPERTIES,
Expand Down Expand Up @@ -78,8 +77,7 @@ export const createReleaseTool: ToolConfig<CreateReleaseParams, ReleaseResponse>
},

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/releases`,
url: (params) => `https://api.github.com/repos/${params.owner}/${params.repo}/releases`,
method: 'POST',
headers: (params) => ({
Accept: 'application/vnd.github+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/delete_branch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubRefPath, githubRepoPath } from '@/tools/github/request-path'
import type { DeleteBranchParams, DeleteBranchResponse } from '@/tools/github/types'
import { DELETE_BRANCH_OUTPUT_PROPERTIES } from '@/tools/github/types'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
Expand Down Expand Up @@ -41,7 +40,7 @@ export const deleteBranchTool: ToolConfig<DeleteBranchParams, DeleteBranchRespon

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/git/refs/heads/${githubRefPath(params.branch, 'branch')}`,
`https://api.github.com/repos/${params.owner}/${params.repo}/git/refs/heads/${params.branch}`,
method: 'DELETE',
headers: (params) => ({
Accept: 'application/vnd.github+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/delete_comment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubPathSegment, githubRepoPath } from '@/tools/github/request-path'
import type { DeleteCommentParams, DeleteCommentResponse } from '@/tools/github/types'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
Expand Down Expand Up @@ -39,7 +38,7 @@ export const deleteCommentTool: ToolConfig<DeleteCommentParams, DeleteCommentRes

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/issues/comments/${githubPathSegment(params.comment_id, 'comment_id')}`,
`https://api.github.com/repos/${params.owner}/${params.repo}/issues/comments/${params.comment_id}`,
method: 'DELETE',
headers: (params) => ({
Accept: 'application/vnd.github+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/delete_comment_reaction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubPathSegment, githubRepoPath } from '@/tools/github/request-path'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'

Expand Down Expand Up @@ -66,7 +65,7 @@ export const deleteCommentReactionTool: ToolConfig<

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/issues/comments/${githubPathSegment(params.comment_id, 'comment_id')}/reactions/${githubPathSegment(params.reaction_id, 'reaction_id')}`,
`https://api.github.com/repos/${params.owner}/${params.repo}/issues/comments/${params.comment_id}/reactions/${params.reaction_id}`,
method: 'DELETE',
headers: (params) => ({
Accept: 'application/vnd.github.squirrel-girl-preview+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/delete_file.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { encodeContentPath } from '@/tools/github/content-path'
import { githubRepoPath } from '@/tools/github/request-path'
import type { DeleteFileParams, DeleteFileResponse } from '@/tools/github/types'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
Expand Down Expand Up @@ -59,7 +58,7 @@ export const deleteFileTool: ToolConfig<DeleteFileParams, DeleteFileResponse> =

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/contents/${encodeContentPath(params.path)}`,
`https://api.github.com/repos/${params.owner}/${params.repo}/contents/${encodeContentPath(params.path)}`,
method: 'DELETE',
headers: (params) => ({
Accept: 'application/vnd.github+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/delete_gist.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubPathSegment } from '@/tools/github/request-path'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'

Expand Down Expand Up @@ -41,7 +40,7 @@ export const deleteGistTool: ToolConfig<DeleteGistParams, DeleteGistResponse> =
},

request: {
url: (params) => `https://api.github.com/gists/${githubPathSegment(params.gist_id, 'gist_id')}`,
url: (params) => `https://api.github.com/gists/${params.gist_id?.trim()}`,
method: 'DELETE',
headers: (params) => ({
Accept: 'application/vnd.github.v3+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/delete_issue_reaction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubPathSegment, githubRepoPath } from '@/tools/github/request-path'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'

Expand Down Expand Up @@ -66,7 +65,7 @@ export const deleteIssueReactionTool: ToolConfig<

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/issues/${githubPathSegment(params.issue_number, 'issue_number')}/reactions/${githubPathSegment(params.reaction_id, 'reaction_id')}`,
`https://api.github.com/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/reactions/${params.reaction_id}`,
method: 'DELETE',
headers: (params) => ({
Accept: 'application/vnd.github.squirrel-girl-preview+json',
Expand Down
3 changes: 1 addition & 2 deletions apps/sim/tools/github/delete_milestone.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { githubPathSegment, githubRepoPath } from '@/tools/github/request-path'
import { GITHUB_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'

Expand Down Expand Up @@ -56,7 +55,7 @@ export const deleteMilestoneTool: ToolConfig<DeleteMilestoneParams, DeleteMilest

request: {
url: (params) =>
`https://api.github.com/repos/${githubRepoPath(params.owner, params.repo)}/milestones/${githubPathSegment(params.milestone_number, 'milestone_number')}`,
`https://api.github.com/repos/${params.owner}/${params.repo}/milestones/${params.milestone_number}`,
method: 'DELETE',
headers: (params) => ({
Accept: 'application/vnd.github.v3+json',
Expand Down
Loading