From a09b46b8981e7a04f72fd6521f419d12c52a4ed0 Mon Sep 17 00:00:00 2001 From: Michael Heap Date: Mon, 4 May 2020 04:59:13 +0100 Subject: [PATCH] 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 --- act/model/action.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/act/model/action.go b/act/model/action.go index d34b1396..e464e7cf 100644 --- a/act/model/action.go +++ b/act/model/action.go @@ -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 }