Skip to content

fix(artifacts): tolerate unknown protobuf fields in artifact server#6053

Open
xingzihai wants to merge 1 commit intonektos:masterfrom
xingzihai:fix-artifact-protobuf-unknown-fields
Open

fix(artifacts): tolerate unknown protobuf fields in artifact server#6053
xingzihai wants to merge 1 commit intonektos:masterfrom
xingzihai:fix-artifact-protobuf-unknown-fields

Conversation

@xingzihai
Copy link
Copy Markdown

Summary

Fixes artifact server compatibility with upload-artifact@v7 by tolerating unknown protobuf fields.

Problem

When using upload-artifact@v7, act's artifact server fails with:

unknown field "mime_type" in CreateArtifactRequest

GitHub added a new mime_type field to the CreateArtifactRequest protobuf message, but act's protobuf definition doesn't include this field. protojson.Unmarshal() uses strict mode by default, rejecting unknown fields.

Solution

Modified parseProtbufBody function in pkg/artifacts/artifacts_v4.go:

// Before
err = protojson.Unmarshal(body, req)

// After
err = protojson.UnmarshalOptions{DiscardUnknown: true}.Unmarshal(body, req)

Using DiscardUnknown: true makes the artifact server forward-compatible with new fields added by GitHub.

Changes

  • pkg/artifacts/artifacts_v4.go (1 line)

Fixes #6022

Use protojson.UnmarshalOptions{DiscardUnknown: true} to parse protobuf
messages from GitHub Actions clients. This makes the artifact server
forward-compatible with new fields added by GitHub, such as the mime_type
field introduced in upload-artifact@v7.

Fixes nektos#6022
bkero added a commit to bkero/external-dns-docker that referenced this pull request Apr 9, 2026
actions/upload-artifact v5+ sends a `mime_type` protobuf field that
act's built-in artifact server cannot decode (nektos/act#6022).
The fix PR (nektos/act#6053) is still unmerged, so pin to v4 — the
last major that works under local act — until upstream lands the fix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Artifact server: CreateArtifact fails with unknown field "mime_type" for upload-artifact@v7

1 participant