Skip to content

Commit 8b0416d

Browse files
committed
ci: make lgtm publish reviews
1 parent 16e742e commit 8b0416d

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

.github/workflows/lgtm.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@ jobs:
4747
--git-api-key "${{ secrets.GITHUB_TOKEN }}" \
4848
--ai-api-key "${{ secrets.AI_API_TOKEN }}" \
4949
-vv \
50+
--publish \
5051
"https://github.com/${{ github.repository }}/pull/${{ github.event.issue.number }}"

internal/compress/extractor.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import (
1212

1313
// ExtractTarGz extracts a tar.gz archive to the specified destination directory.
1414
func ExtractTarGz(reader io.Reader, destDir string) error {
15+
if _, err := os.Stat(destDir); os.IsNotExist(err) {
16+
return fmt.Errorf("destination directory does not exist: %s", destDir)
17+
}
18+
1519
gzReader, err := gzip.NewReader(reader)
1620
if err != nil {
1721
return fmt.Errorf("failed to create gzip reader: %w", err)

internal/repository/github/github.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"fmt"
77

88
"net/http"
9-
"os"
109
"sheriff/internal/compress"
1110
"sheriff/internal/repository"
1211
"strings"
@@ -116,11 +115,6 @@ func (s githubService) DownloadRepository(project repository.Project, dir string
116115
return fmt.Errorf("failed to download GitHub archive, status: %s", resp.Status)
117116
}
118117

119-
// Create directory if it doesn't exist
120-
if err := os.MkdirAll(dir, 0755); err != nil {
121-
return fmt.Errorf("failed to create directory: %w", err)
122-
}
123-
124118
return compress.ExtractTarGz(resp.Body, dir)
125119
}
126120

0 commit comments

Comments
 (0)