Skip to content
Merged
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
11 changes: 8 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4694,12 +4694,14 @@ async function getPipelineJobOutput(
* @param {string} projectId - The ID or URL-encoded path of the project
* @param {string} ref - The branch or tag to run the pipeline on
* @param {Array} variables - Optional variables for the pipeline
* @param {Record<string, string>} inputs - Optional input parameters for the pipeline
* @returns {Promise<GitLabPipeline>} The created pipeline
*/
async function createPipeline(
projectId: string,
ref: string,
variables?: Array<{ key: string; value: string }>
variables?: Array<{ key: string; value: string }>,
inputs?: Record<string, string>
): Promise<GitLabPipeline> {
projectId = decodeURIComponent(projectId); // Decode project ID
const url = new URL(
Expand All @@ -4710,6 +4712,9 @@ async function createPipeline(
if (variables && variables.length > 0) {
body.variables = variables;
}
if (inputs && Object.keys(inputs).length > 0) {
body.inputs = inputs;
}

const response = await fetch(url.toString(), {
method: "POST",
Expand Down Expand Up @@ -6898,8 +6903,8 @@ async function handleToolCall(params: any) {
}

case "create_pipeline": {
const { project_id, ref, variables } = CreatePipelineSchema.parse(params.arguments);
const pipeline = await createPipeline(project_id, ref, variables);
const { project_id, ref, variables, inputs } = CreatePipelineSchema.parse(params.arguments);
const pipeline = await createPipeline(project_id, ref, variables, inputs);
return {
content: [
{
Expand Down
4 changes: 4 additions & 0 deletions schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ export const CreatePipelineSchema = z.object({
)
.optional()
.describe("An array of variables to use for the pipeline"),
inputs: z
.record(z.string(), z.string())
.optional()
.describe("Input parameters for the pipeline (key-value pairs for spec:inputs)"),
});

// Schema for retrying a pipeline
Expand Down
Loading