mirror of
https://github.com/hanzo-git/runner.git
synced 2026-10-30 19:33:27 +00:00
Native runner: module github.com/hanzo-git/runner, wire proto github.com/hanzo-git/actions-proto-go, command git-runner, GIT_* env, git expr context, git_* task-context keys, ghcr.io/hanzoai/runner-ubuntu job images. Derived work — upstream attribution + MIT terms in NOTICE/LICENSE. Co-authored-by: Hanzo Dev <[email protected]>
50 lines
974 B
Go
50 lines
974 B
Go
// Copyright 2022 The Git Authors. All rights reserved.
|
|
// Copyright 2021 The nektos/act Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package model
|
|
|
|
import "fmt"
|
|
|
|
type stepStatus int
|
|
|
|
const (
|
|
StepStatusSuccess stepStatus = iota
|
|
StepStatusFailure
|
|
StepStatusSkipped
|
|
)
|
|
|
|
var stepStatusStrings = [...]string{
|
|
"success",
|
|
"failure",
|
|
"skipped",
|
|
}
|
|
|
|
func (s stepStatus) MarshalText() ([]byte, error) {
|
|
return []byte(s.String()), nil
|
|
}
|
|
|
|
func (s *stepStatus) UnmarshalText(b []byte) error {
|
|
str := string(b)
|
|
for i, name := range stepStatusStrings {
|
|
if name == str {
|
|
*s = stepStatus(i)
|
|
return nil
|
|
}
|
|
}
|
|
return fmt.Errorf("invalid step status %q", str)
|
|
}
|
|
|
|
func (s stepStatus) String() string {
|
|
if int(s) >= len(stepStatusStrings) {
|
|
return ""
|
|
}
|
|
return stepStatusStrings[s]
|
|
}
|
|
|
|
type StepResult struct {
|
|
Outputs map[string]string `json:"outputs"`
|
|
Conclusion stepStatus `json:"conclusion"`
|
|
Outcome stepStatus `json:"outcome"`
|
|
}
|