Skip to content

Commit d7af389

Browse files
committed
fix: address CI security and lint warnings
- Change directory permissions from 0755 to 0750 - Rename unused request parameters to _
1 parent 3283668 commit d7af389

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

internal/cmd/issue/attachment/download/download.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func download(cmd *cobra.Command, args []string) {
7272
}
7373

7474
// Create output directory
75-
if err := os.MkdirAll(outputDir, 0755); err != nil {
75+
if err := os.MkdirAll(outputDir, 0o750); err != nil {
7676
cmdutil.ExitIfError(fmt.Errorf("failed to create directory %s: %w", outputDir, err))
7777
}
7878

pkg/jira/attachment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (c *Client) DownloadAttachment(contentURL, targetPath string) error {
7272

7373
// Ensure directory exists
7474
dir := filepath.Dir(targetPath)
75-
if err := os.MkdirAll(dir, 0755); err != nil {
75+
if err := os.MkdirAll(dir, 0o750); err != nil {
7676
return fmt.Errorf("failed to create directory: %w", err)
7777
}
7878

pkg/jira/attachment_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestGetIssueAttachmentsV2(t *testing.T) {
5757
}
5858

5959
func TestGetIssueAttachments_NoAttachments(t *testing.T) {
60-
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
60+
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
6161
w.Header().Set("Content-Type", "application/json")
6262
w.WriteHeader(200)
6363
_, _ = w.Write([]byte(`{"key": "TEST-1", "fields": {"attachment": []}}`))
@@ -74,7 +74,7 @@ func TestGetIssueAttachments_NoAttachments(t *testing.T) {
7474
func TestDownloadAttachment(t *testing.T) {
7575
expectedContent := []byte("test file content")
7676

77-
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
77+
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
7878
w.Header().Set("Content-Type", "application/octet-stream")
7979
w.WriteHeader(200)
8080
_, _ = w.Write(expectedContent)
@@ -97,7 +97,7 @@ func TestDownloadAttachment(t *testing.T) {
9797
}
9898

9999
func TestDownloadAttachment_HTTPError(t *testing.T) {
100-
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
100+
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
101101
w.WriteHeader(404)
102102
}))
103103
defer server.Close()

0 commit comments

Comments
 (0)