actions

package
v1.26.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 37 Imported by: 0

Documentation

Overview

GitHub Actions Artifacts v4 protocol messages — plain Go structs, no protobuf.

This replaces the generated artifact.pb.go. That file registered a protobuf FileDescriptor at package init from an embedded rawDesc; a version skew between the generator and the linked google.golang.org/protobuf runtime made the descriptor unparseable and the binary panicked at startup ("slice bounds out of range" in unmarshalSeed) before it could serve anything. The Actions artifact wire format is already JSON (the handler used protojson, Content-Type application/json), so protobuf bought nothing here but a fragile init.

These structs serialize with encoding/json to the SAME proto3-JSON bytes the act_runner exchanges: lowerCamelCase field names, int64 as a JSON string, a Timestamp as an RFC 3339 string, and the well-known wrappers (StringValue, Int64Value) as their bare primitive. artifact_wire_test.go locks that byte contract with golden vectors so the runner protocol cannot silently drift.

Index

Constants

View Source
const ArtifactV4RouteBase = "/twirp/github.actions.results.api.v1.ArtifactService"

Variables

This section is empty.

Functions

func ArtifactContexter

func ArtifactContexter() func(next http.Handler) http.Handler

func ArtifactV4Contexter

func ArtifactV4Contexter() func(next http.Handler) http.Handler

func ArtifactsRoutes

func ArtifactsRoutes(prefix string) *web.Router

func ArtifactsV4Routes

func ArtifactsV4Routes(prefix string) *web.Router

func Routes

func Routes(prefix string) *web.Router

Types

type ArtifactContext

type ArtifactContext struct {
	*context.Base

	ActionTask *actions.ActionTask
}

type BlockList

type BlockList struct {
	Latest []string `xml:"Latest"`
}

type CreateArtifactRequest

type CreateArtifactRequest struct {
	WorkflowRunBackendId    string       `json:"workflowRunBackendId,omitempty"`
	WorkflowJobRunBackendId string       `json:"workflowJobRunBackendId,omitempty"`
	Name                    string       `json:"name,omitempty"`
	ExpiresAt               *Timestamp   `json:"expiresAt,omitempty"`
	Version                 int32        `json:"version,omitempty"`
	MimeType                *StringValue `json:"mimeType,omitempty"`
}

func (*CreateArtifactRequest) GetMimeType

func (x *CreateArtifactRequest) GetMimeType() *StringValue

type CreateArtifactResponse

type CreateArtifactResponse struct {
	Ok              bool   `json:"ok,omitempty"`
	SignedUploadUrl string `json:"signedUploadUrl,omitempty"`
}

type DeleteArtifactRequest

type DeleteArtifactRequest struct {
	WorkflowRunBackendId    string `json:"workflowRunBackendId,omitempty"`
	WorkflowJobRunBackendId string `json:"workflowJobRunBackendId,omitempty"`
	Name                    string `json:"name,omitempty"`
}

type DeleteArtifactResponse

type DeleteArtifactResponse struct {
	Ok         bool  `json:"ok,omitempty"`
	ArtifactId int64 `json:"artifactId,string,omitempty"`
}

type FinalizeArtifactRequest

type FinalizeArtifactRequest struct {
	WorkflowRunBackendId    string       `json:"workflowRunBackendId,omitempty"`
	WorkflowJobRunBackendId string       `json:"workflowJobRunBackendId,omitempty"`
	Name                    string       `json:"name,omitempty"`
	Size                    int64        `json:"size,string,omitempty"`
	Hash                    *StringValue `json:"hash,omitempty"`
}

func (*FinalizeArtifactRequest) GetHash

func (x *FinalizeArtifactRequest) GetHash() *StringValue

type FinalizeArtifactResponse

type FinalizeArtifactResponse struct {
	Ok         bool  `json:"ok,omitempty"`
	ArtifactId int64 `json:"artifactId,string,omitempty"`
}

type GetSignedArtifactURLRequest

type GetSignedArtifactURLRequest struct {
	WorkflowRunBackendId    string `json:"workflowRunBackendId,omitempty"`
	WorkflowJobRunBackendId string `json:"workflowJobRunBackendId,omitempty"`
	Name                    string `json:"name,omitempty"`
}

type GetSignedArtifactURLResponse

type GetSignedArtifactURLResponse struct {
	SignedUrl string `json:"signedUrl,omitempty"`
}

type Int64Value added in v1.26.7

type Int64Value struct{ Value int64 }

Int64Value mirrors google.protobuf.Int64Value: a nullable int64 encoded (per proto3-JSON) as a JSON string. Unmarshal also tolerates a bare JSON number.

func (*Int64Value) GetValue added in v1.26.7

func (v *Int64Value) GetValue() int64

func (Int64Value) MarshalJSON added in v1.26.7

func (v Int64Value) MarshalJSON() ([]byte, error)

func (*Int64Value) UnmarshalJSON added in v1.26.7

func (v *Int64Value) UnmarshalJSON(b []byte) error

type Latest

type Latest struct {
	Value string `xml:",chardata"`
}

type ListArtifactsRequest

type ListArtifactsRequest struct {
	WorkflowRunBackendId    string       `json:"workflowRunBackendId,omitempty"`
	WorkflowJobRunBackendId string       `json:"workflowJobRunBackendId,omitempty"`
	NameFilter              *StringValue `json:"nameFilter,omitempty"`
	IdFilter                *Int64Value  `json:"idFilter,omitempty"`
}

type ListArtifactsResponse

type ListArtifactsResponse struct {
	Artifacts []*ListArtifactsResponse_MonolithArtifact `json:"artifacts,omitempty"`
}

type ListArtifactsResponse_MonolithArtifact

type ListArtifactsResponse_MonolithArtifact struct {
	WorkflowRunBackendId    string     `json:"workflowRunBackendId,omitempty"`
	WorkflowJobRunBackendId string     `json:"workflowJobRunBackendId,omitempty"`
	DatabaseId              int64      `json:"databaseId,string,omitempty"`
	Name                    string     `json:"name,omitempty"`
	Size                    int64      `json:"size,string,omitempty"`
	CreatedAt               *Timestamp `json:"createdAt,omitempty"`
}

type StringValue added in v1.26.7

type StringValue struct{ Value string }

StringValue mirrors google.protobuf.StringValue: a nullable string encoded as a bare JSON string. GetValue is nil-safe (the generated getter's contract).

func (*StringValue) GetValue added in v1.26.7

func (s *StringValue) GetValue() string

func (StringValue) MarshalJSON added in v1.26.7

func (s StringValue) MarshalJSON() ([]byte, error)

func (*StringValue) UnmarshalJSON added in v1.26.7

func (s *StringValue) UnmarshalJSON(b []byte) error

type Timestamp added in v1.26.7

type Timestamp struct{ time.Time }

Timestamp mirrors google.protobuf.Timestamp's proto3-JSON encoding: an RFC 3339 string. It keeps the AsTime()/New() surface the handler used.

func New added in v1.26.7

func New(t time.Time) *Timestamp

New wraps a time.Time as a *Timestamp (drop-in for timestamppb.New).

func (*Timestamp) AsTime added in v1.26.7

func (t *Timestamp) AsTime() time.Time

AsTime returns the wrapped time (zero value for a nil receiver).

func (Timestamp) MarshalJSON added in v1.26.7

func (t Timestamp) MarshalJSON() ([]byte, error)

func (*Timestamp) UnmarshalJSON added in v1.26.7

func (t *Timestamp) UnmarshalJSON(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL