fix: anchor cyclic detection (#30)

Closes #25

Reviewed-on: https://gitea.com/actions-oss/act-cli/pulls/30
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
This commit is contained in:
Christopher Homberger
2026-02-02 20:43:49 +00:00
committed by ChristopherHX
parent 13e0654fd7
commit 6c827eba95
3 changed files with 98 additions and 26 deletions

View File

@@ -614,17 +614,21 @@ jobs:
func TestReadWorkflow_Anchor(t *testing.T) {
yaml := `
on: push
jobs:
test:
runs-on: &runner ubuntu-latest
steps:
- uses: &checkout actions/checkout@v5
test2:
test2: &job
runs-on: *runner
steps:
- uses: *checkout
- run: echo $TRIGGER
env:
TRIGGER: &trigger push
test3: *job
on: push #*trigger
`
w, err := ReadWorkflow(strings.NewReader(yaml), false)