Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Commit

Permalink
fix: add extra case for gitlab repo dir name (#654)
Browse files Browse the repository at this point in the history
This was a small change we had to make for solving the issue with #651
wherein we see a different name structure for the directory within the
tarball that we get from gitlab
  • Loading branch information
jpetrucciani committed Dec 6, 2023
1 parent e328a80 commit 5424565
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/gitlab/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,14 @@ func (g *Client) GetRepoTarball(ctx context.Context, opts vcs.GetRepoTarballOpti
}
dir := contents[0].Name()
parts := strings.Split(dir, "-")
if len(parts) != 2 {
if len(parts) < 2 {
return nil, "", fmt.Errorf("malformed directory name found in tarball: %s", dir)
}
tarball, err = internal.Pack(path.Join(untarpath, dir))
if err != nil {
return nil, "", err
}
return tarball, parts[1], nil
return tarball, parts[len(parts)-1], nil
}

func (g *Client) CreateWebhook(ctx context.Context, opts vcs.CreateWebhookOptions) (string, error) {
Expand Down

0 comments on commit 5424565

Please sign in to comment.