0
List Commits
One script reply has been approved by the moderators Verified
Created by sebastienfa6ll 632 days ago Viewed 384 times
0
Submitted by jaller94 Deno
Verified 515 days ago
1
/*
2
@param: {Gitlab} glab - Resource containing Gitlab Auth API Key
3
Example:
4
{
5
  baseUrl: "https://gitlab.com"
6
  token: gitlab_api_key
7
}
8
*/
9
type Gitlab = {
10
  baseUrl: string;
11
  token: string;
12
};
13
export async function main(glab: Gitlab, projectId: string) {
14
  const url = `${glab.baseUrl}/api/v4/projects/${projectId}/repository/commits`;
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

Other submissions