mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-04 14:35:32 +00:00
Support configuration variables (#43)
related to: https://gitea.com/gitea/act_runner/issues/127 This PR make `act` support the expression like `${{ vars.YOUR_CUSTOM_VARIABLES }}`. Reviewed-on: https://gitea.com/gitea/act/pulls/43 Reviewed-by: Jason Song <[email protected]> Co-authored-by: sillyguodong <[email protected]> Co-committed-by: sillyguodong <[email protected]>
This commit is contained in:
1 parent
d3a56cdb69
commit
de529139af
5 files changed
+15
No files matched your search
@@ -23,6 +23,8 @@ type EvaluationEnvironment struct {
|
||||
Matrix map[string]interface{}
|
||||
Needs map[string]Needs
|
||||
Inputs map[string]interface{}
|
||||
|
||||
Vars map[string]string
|
||||
}
|
||||
|
||||
type Needs struct {
|
||||
@@ -181,6 +183,8 @@ func (impl *interperterImpl) evaluateVariable(variableNode *actionlint.VariableN
|
||||
return math.Inf(1), nil
|
||||
case "nan":
|
||||
return math.NaN(), nil
|
||||
case "vars":
|
||||
return impl.env.Vars, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("Unavailable context: %s", variableNode.Name)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user