1 | import * as wmill from "https://deno.land/x/windmill@v1.34.0/mod.ts"; |
2 |
|
3 | @param: {wmill.Resource<"gitlab">} glab - Resource containing Gitlab Auth API Key |
4 | Example: |
5 | { |
6 | auth: gitlab_api_key, |
7 | baseUrl: "https://www.gitlab.com" |
8 | } |
9 | */ |
10 | export async function main( |
11 | glab: wmill.Resource<"gitlab">, |
12 | projectId: string, |
13 | ) { |
14 | const url = `${glab.baseUrl}/api/v4/projects/${projectId}/repository/branches`; |
15 | const issue = await fetch(`${url}`, { |
16 | headers: { |
17 | "Authorization": `Bearer: ${glab.token}`, |
18 | "Content-Type": "application/json", |
19 | } |
20 | }); |
21 | return await issue.json(); |
22 | } |
23 |
|