fix(deps): update to actionslib v1.0.0 (#1221)

Updates `gitea.dev/actionslib` to v1.0.0, see https://gitea.com/gitea/actionslib/pulls/17:

1. First-party expression parser passing GitHub's full conformance suite, replacing actionlint
1. Expression results match GitHub, including truthiness, numbers, `fromJSON`, `toJSON` and `hashFiles` cache keys
1. Whole-value `${{ }}` works for `strategy`, `env`, `with`, `services` and `outputs`
1. Matrix validation matches GitHub

---------

Co-authored-by: bircni <bircni@icloud.com>
Reviewed-on: https://gitea.com/gitea/runner/pulls/1221
Reviewed-by: bircni <bircni@icloud.com>
Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
silverwind
2026-09-14 18:41:37 +00:00
committed by bircni
co-authored by bircni
parent e0ce6776c7
commit 3d116eb0c2
16 changed files with 264 additions and 76 deletions
+4 -4
View File
@@ -391,10 +391,10 @@ func warnUnknownKeys(file string, content []byte) {
decoder := yaml.NewDecoder(bytes.NewReader(content))
decoder.KnownFields(true)
var typeErr *yaml.TypeError
if err := decoder.Decode(&Config{}); errors.As(err, &typeErr) {
for _, message := range typeErr.Errors {
log.Warnf("config file %q: %s, it will be ignored", file, message)
var loadErrs *yaml.LoadErrors
if err := decoder.Decode(&Config{}); errors.As(err, &loadErrs) {
for _, loadErr := range loadErrs.Errors {
log.Warnf("config file %q: %s, it will be ignored", file, loadErr)
}
}
}
+12
View File
@@ -312,7 +312,19 @@ func allScalars(nodes []*yaml.Node) bool {
return true
}
// quoteLeadingNewlines keeps a scalar starting with a newline out of block style, whose indentation indicator the encoder drops.
// TODO: remove once https://github.com/yaml/go-yaml/pull/396 is released.
func quoteLeadingNewlines(node *yaml.Node) {
if node.Kind == yaml.ScalarNode && strings.HasPrefix(node.Value, "\n") {
node.Style = yaml.DoubleQuotedStyle
}
for _, child := range node.Content {
quoteLeadingNewlines(child)
}
}
func encodeYAML(node *yaml.Node) ([]byte, error) {
quoteLeadingNewlines(node)
var buf bytes.Buffer
encoder := yaml.NewEncoder(&buf)
encoder.SetIndent(2)
+7
View File
@@ -74,6 +74,13 @@ func TestEditValues(t *testing.T) {
assert.Equal(t, map[string]string{"EXISTING": "value", "ADDED": "yes"}, cfg.Runner.Envs)
},
},
{
name: "set map entry starting with a newline before an indented line",
edit: func(file string) error { return SetValue(file, "runner.envs.ADDED", "\n indented\nplain\n") },
assert: func(t *testing.T, cfg *Config, _ string) {
assert.Equal(t, "\n indented\nplain\n", cfg.Runner.Envs["ADDED"])
},
},
{
name: "set replaces a list",
edit: func(file string) error { return SetValue(file, "runner.labels", "one", "two") },