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

[FORGEJO] when a workflow decode error happen, log and do not crash

This commit is contained in:
Earl Warren 2024-09-15 15:46:01 +02:00
parent 81c1530fce
commit 61b7859f12
2 changed files with 20 additions and 1 deletions

View file

@ -153,6 +153,25 @@ jobs:
assert.Contains(t, workflow.On(), "pull_request")
}
func TestReadWorkflow_DecodeNodeError(t *testing.T) {
yaml := `
on:
push:
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: echo
env:
foo: {{ a }}
`
workflow, err := ReadWorkflow(strings.NewReader(yaml))
assert.NoError(t, err, "read workflow should succeed")
assert.Nil(t, workflow.GetJob("test").Steps[0].GetEnv())
}
func TestReadWorkflow_RunsOnLabels(t *testing.T) {
yaml := `
name: local-action-docker-url