MCPcopy Create free account
hub / github.com/github/gh-aw / TestExtractDispatchWorkflowNames_SkipMacros

Function TestExtractDispatchWorkflowNames_SkipMacros

pkg/cli/remote_workflow_test.go:728–743  ·  view source on GitHub ↗

TestExtractDispatchWorkflowNames_SkipMacros verifies that workflow names containing GitHub Actions expression syntax are filtered out.

(t *testing.T)

Source from the content-addressed store, hash-verified

726// TestExtractDispatchWorkflowNames_SkipMacros verifies that workflow names containing
727// GitHub Actions expression syntax are filtered out.
728func TestExtractDispatchWorkflowNames_SkipMacros(t *testing.T) {
729 content := `---
730engine: copilot
731safe-outputs:
732 dispatch-workflow:
733 - plain-workflow
734 - ${{ vars.WORKFLOW_NAME }}
735 - ${{ needs.step.outputs.workflow }}
736 - another-plain-workflow
737---
738
739# Workflow
740`
741 names := extractDispatchWorkflowNames(content)
742 assert.Equal(t, []string{"plain-workflow", "another-plain-workflow"}, names, "should skip workflow names with GitHub Actions macro syntax")
743}
744
745// TestExtractDispatchWorkflowNames_NoSafeOutputs verifies that an empty slice is returned
746// when there is no safe-outputs section.

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected