chore(deps): update actionslib to v1.0.0 (#39295)

Co-authored-by: bircni <bircni@icloud.com>
This commit is contained in:
silverwind
2026-09-14 16:29:31 +02:00
committed by GitHub
co-authored by bircni
parent cefb81a16f
commit 13033827b1
13 changed files with 54 additions and 99 deletions
+2 -11
View File
@@ -14,7 +14,6 @@ import (
"gitea.dev/actionslib/pkg/exprparser"
"gitea.dev/actionslib/pkg/model"
"github.com/rhysd/actionlint"
"go.yaml.in/yaml/v4"
)
@@ -60,13 +59,13 @@ func ParseRawSingleWorkflow(payload []byte) (*SingleWorkflow, *Job, error) {
// those too would replace their combinations with one placeholder and change the commit status
// contexts the run publishes, which a repository's required checks are configured against.
func expressionReadsNeeds(value string) bool {
return expressionReadsContext(value, "needs")
return expreval.ReadsContext(value, "needs")
}
// ExpressionReadsMatrix reports whether a job's `if:` reads the matrix context.
// A deferred-matrix placeholder has no combination yet, so such an expression cannot be decided.
func ExpressionReadsMatrix(ifValue string) bool {
return expressionReadsContext(asIfExpression(ifValue), "matrix")
return expreval.ReadsContext(asIfExpression(ifValue), "matrix")
}
// ExpressionIgnoresNeedResults reports whether a job's `if:` calls always(), failure() or cancelled(),
@@ -86,14 +85,6 @@ func asIfExpression(ifValue string) string {
return "${{ " + ifValue + " }}"
}
// expressionReadsContext reports whether value holds a ${{ }} expression reading the named context.
func expressionReadsContext(value, contextName string) bool {
return expreval.Match(value, func(node actionlint.ExprNode) bool {
variable, ok := node.(*actionlint.VariableNode)
return ok && strings.EqualFold(variable.Name, contextName)
})
}
func Parse(content []byte, options ...ParseOption) ([]*SingleWorkflow, error) {
// The workflow is split into one document per job below, which would strand an alias whose
// anchor lands in another one.