From 9021a5f8f7c4a15bf7368c2aed3f3231d6f69f63 Mon Sep 17 00:00:00 2001 From: Jeff Carter Date: Thu, 26 Mar 2026 09:37:06 -0400 Subject: [PATCH 1/2] Fix GHA workflow triggers --- .github/workflows/oci-lint.yml | 3 +-- .github/workflows/oci-tag.yml | 3 +-- .github/workflows/oci-test.yml | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/oci-lint.yml b/.github/workflows/oci-lint.yml index b6d8bdd..24095ea 100644 --- a/.github/workflows/oci-lint.yml +++ b/.github/workflows/oci-lint.yml @@ -3,8 +3,7 @@ name: "oci: lint" on: pull_request: paths: - - "./**" - - ".github/workflows/oci-lint.yml" + - "**" permissions: contents: read diff --git a/.github/workflows/oci-tag.yml b/.github/workflows/oci-tag.yml index f4ce8bf..fbdb453 100644 --- a/.github/workflows/oci-tag.yml +++ b/.github/workflows/oci-tag.yml @@ -5,8 +5,7 @@ on: branches: - main paths: - - "./**" - - ".github/workflows/oci-tag.yml" + - "**" permissions: contents: write diff --git a/.github/workflows/oci-test.yml b/.github/workflows/oci-test.yml index ce417a6..4dd7b0b 100644 --- a/.github/workflows/oci-test.yml +++ b/.github/workflows/oci-test.yml @@ -3,8 +3,7 @@ name: "oci: test" on: pull_request: paths: - - "./**" - - ".github/workflows/oci-test.yml" + - "**" permissions: contents: read From 75688553f4c6694f9958163172978923ac1e31dc Mon Sep 17 00:00:00 2001 From: Jeff Carter Date: Thu, 26 Mar 2026 09:41:59 -0400 Subject: [PATCH 2/2] Fix linting --- ocilarge/upload.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ocilarge/upload.go b/ocilarge/upload.go index 34e8bb2..b3b75f1 100644 --- a/ocilarge/upload.go +++ b/ocilarge/upload.go @@ -9,6 +9,7 @@ import ( "github.com/opencontainers/go-digest" ) +// UploadLargeBlob uploads a large blob in chunks with retries so that uploads can be resumed in case of network error func UploadLargeBlob(ctx context.Context, reg oci.Interface, repo string, f io.ReadCloser, chunkSize int) (oci.Descriptor, error) { defer f.Close() if chunkSize <= 0 { @@ -18,7 +19,7 @@ func UploadLargeBlob(ctx context.Context, reg oci.Interface, repo string, f io.R if err != nil { return oci.Descriptor{}, fmt.Errorf("starting chunked upload: %w", err) } - defer bw.Cancel() // no-op after a successful Commit + defer func() { _ = bw.Cancel() }() // no-op after a successful Commit buf := make([]byte, chunkSize) dgstr := digest.Canonical.Digester() @@ -28,7 +29,7 @@ func UploadLargeBlob(ctx context.Context, reg oci.Interface, repo string, f io.R dgstr.Hash().Write(buf[:n]) var writeErr error - for i := 0; i < 3; i++ { // try writing each chunk three times + for range 3 { // try writing each chunk three times _, writeErr = bw.Write(buf[:n]) if writeErr == nil { break