TestExtractDispatchWorkflowNames_SkipMacros verifies that workflow names containing GitHub Actions expression syntax are filtered out.
(t *testing.T)
| 726 | // TestExtractDispatchWorkflowNames_SkipMacros verifies that workflow names containing |
| 727 | // GitHub Actions expression syntax are filtered out. |
| 728 | func TestExtractDispatchWorkflowNames_SkipMacros(t *testing.T) { |
| 729 | content := `--- |
| 730 | engine: copilot |
| 731 | safe-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. |
nothing calls this directly
no test coverage detected