diff --git a/.github/dependabot.yml b/.github/dependabot.yml index bde3af38..1944d7d6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -17,6 +17,7 @@ updates: directory: "/" schedule: interval: "weekly" + target-branch: "develop" reviewers: - "noslav" - "rogarcia" diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 216c8d6d..e8711598 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -12,6 +12,10 @@ jobs: bsp-agent-eth: runs-on: ubuntu-latest steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.6.0 + with: + access_token: ${{ secrets.GITHUB_TOKEN }} - name: Login to GitHub Container Registry if: ${{ !env.ACT }} uses: docker/login-action@v1 diff --git a/internal/storage/ipfs.go b/internal/storage/ipfs.go index 2f0c41a7..b5d7b4a3 100644 --- a/internal/storage/ipfs.go +++ b/internal/storage/ipfs.go @@ -104,12 +104,19 @@ func (store *ipfsStore) createMultiformWriter(contents []byte) (*bytes.Buffer, s body := &bytes.Buffer{} writer := multipart.NewWriter(body) - if err := writer.WriteField("filedata", string(contents)); err != nil { - return body, "", fmt.Errorf("error writing form field: %w", err) + // Create a new form-data header with the filename and write the file content + part, err := writer.CreateFormFile("file", "specimen") + if err != nil { + return nil, "", fmt.Errorf("error creating form file: %w", err) + } + + if _, err := part.Write(contents); err != nil { + return nil, "", fmt.Errorf("error writing file content: %w", err) } + // Close the multipart writer if err := writer.Close(); err != nil { - log.Error("error closing multipart writer", err) + return nil, "", fmt.Errorf("error closing multipart writer: %w", err) } return body, writer.FormDataContentType(), nil