0

Parse Terraform variables from Git repository

by
Published Oct 17, 2025
Script qovery Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Parse Terraform variables from Git repository
4
 *
5
 */
6
export async function main(auth: RT.Qovery, organizationId: string, body: Body) {
7
	const url = new URL(
8
		`https://api.qovery.com/organization/${organizationId}/parseTerraformVariablesFromGitRepo`
9
	)
10

11
	const response = await fetch(url, {
12
		method: 'POST',
13
		headers: {
14
			'Content-Type': 'application/json',
15
			Authorization: 'Token ' + auth.apiKey
16
		},
17
		body: JSON.stringify(body)
18
	})
19
	if (!response.ok) {
20
		const text = await response.text()
21
		throw new Error(`${response.status} ${text}`)
22
	}
23
	return await response.json()
24
}
25

26
/* eslint-disable */
27
/**
28
 * This file was automatically generated by json-schema-to-typescript.
29
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
30
 * and run json-schema-to-typescript to regenerate this file.
31
 */
32

33
export interface Body {
34
	git_repository: {
35
		/**
36
		 * application git repository URL
37
		 */
38
		url: string
39
		/**
40
		 * Name of the branch to use. This is optional
41
		 * If not specified, then the branch used is the `main` or `master` one
42
		 *
43
		 */
44
		branch?: string
45
		/**
46
		 * indicates the root path of the application.
47
		 */
48
		root_path?: string
49
		/**
50
		 * The git token id on Qovery side
51
		 */
52
		git_token_id?: string
53
		provider: 'BITBUCKET' | 'GITHUB' | 'GITLAB'
54
		[k: string]: unknown
55
	}
56
	[k: string]: unknown
57
}
58