Search... Ctrl + K

List Commits (gitlab)
One script reply has been approved by the moderators Verified

Created by sebastienfa6ll 177 days ago Used 48 times 0 Points

No comments yet

Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
import * as wmill from "https://deno.land/x/windmill@v1.34.0/mod.ts";
/*
@param: {wmill.Resource<"gitlab">} glab - Resource containing Gitlab Auth API Key
Example:
{
  baseUrl: "https://gitlab.com"
  token: gitlab_api_key
}
*/
export async function main(
  glab: wmill.Resource<"gitlab">,
  projectId: string,
) {
  const url = `${glab.baseUrl}/api/v4/projects/${projectId}/repository/commits`;
  const issue = await fetch(`${url}`, {
    headers: {
      "Authorization": `Bearer: ${glab.token}`,
      "Content-Type": "application/json",
    },
  });
  return await issue.json();
}

Submitted by jaller94 61 days ago

Edited 59 days ago

No comments yet