1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-11 17:50:58 +00:00

Normalise Runs.Using to lowercase (#222)

Currently, providing `using: Docker` is an error as the switch statement in `step_context.go` is case sensitive.

Actions run successfully on GitHub with `using: Docker` leading me to believe that they're case insensitive. This commit updates `act` to match

Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
Michael Heap 2020-05-04 04:59:13 +01:00 committed by GitHub
parent c9b0a309da
commit a09b46b898

View file

@ -2,6 +2,7 @@ package model
import (
"io"
"strings"
"gopkg.in/yaml.v3"
)
@ -53,5 +54,9 @@ type Output struct {
func ReadAction(in io.Reader) (*Action, error) {
a := new(Action)
err := yaml.NewDecoder(in).Decode(a)
// Normalise Runs.Using to lowercase so that Docker and docker are
// equivalent when evaluating a step context
a.Runs.Using = ActionRunsUsing(strings.ToLower(string(a.Runs.Using)))
return a, err
}