Edits history of script submission #150 for ' Get Repo Branch (gitlab)'

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    /*
    @param: {wmill.Resource<"gitlab">} glab - Resource containing Gitlab Auth API Key
    Example:
    {
      auth: gitlab_api_key,
      baseUrl: "https://www.gitlab.com"
    }
    */
    export async function main(
      glab: wmill.Resource<"gitlab">,
      projectId: string,
      branchName: string
    ) {
      const url = `${glab.baseUrl}/api/v4/projects/${projectId}/repository/branches/${branchName}`;
      const issue = await fetch(`${url}`, {
        headers: {
          "Authorization": `Bearer: ${glab.token}`,
          "Content-Type": "application/json",
        }
      });
      return await issue.json();
    }
    

    Submitted by lplit 1333 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    /*
    @param: {wmill.Resource<"gitlab">} glab - Resource containing Gitlab Auth API Key
    Example:
    {
      auth: gitlab_api_key
    }
    */
    export async function main(
      glab: wmill.Resource<"gitlab">,
      projectId: string,
      branchName: string
    ) {
      const url = `https://gitlab.com/api/v4/projects/${projectId}/repository/branches/${branchName}`;
      const issue = await fetch(`${url}`, {
        headers: {
          "Authorization": `Bearer: ${glab.token}`,
          "Content-Type": "application/json",
        }
      });
      return await issue.json();
    }
    

    Submitted by lplit 1371 days ago