diff --git a/lib/cli-create.ts b/lib/cli-create.ts index 867aad2..8916775 100644 --- a/lib/cli-create.ts +++ b/lib/cli-create.ts @@ -36,7 +36,7 @@ export async function createAction(options: CreateOptions) { if (response instanceof AxiosError) { throw response; } - if (response.status !== 200) { + if (response.status / 100 === 2) { console.error(`Failed to create merge request: ${JSON.stringify(response.data)}, Status ${response.status}`); throw new Error(`Failed to accept merge request`); } diff --git a/lib/cli-list.ts b/lib/cli-list.ts index a153f1b..c28991d 100644 --- a/lib/cli-list.ts +++ b/lib/cli-list.ts @@ -32,7 +32,7 @@ export async function listAction(options: ListOptions) { if (response instanceof AxiosError) { throw response; } - if (response.status !== 200) { + if (response.status / 100 === 2) { console.error(`Failed to create merge request: ${JSON.stringify(response.data)}, Status ${response.status}`); throw new Error(`Failed to accept merge request`); } diff --git a/lib/cli-merge.ts b/lib/cli-merge.ts index cba9a8c..4f94c17 100644 --- a/lib/cli-merge.ts +++ b/lib/cli-merge.ts @@ -33,7 +33,7 @@ export async function mergeAction(options: AcceptOptions) { if (response instanceof AxiosError) { throw response; } - if (response.status !== 200) { + if (response.status / 100 === 2) { console.error(`Failed to accept merge request: ${JSON.stringify(response.data)}, Status ${response.status}`); throw new Error(`Failed to accept merge request`); }