From 7cf8b504f07884e5a921201626acf69fa3c4d511 Mon Sep 17 00:00:00 2001 From: Virgil Date: Wed, 1 Apr 2026 22:33:34 +0000 Subject: [PATCH] feat(build): treat current directory as workflow target Co-Authored-By: Virgil --- pkg/build/workflow.go | 4 ++++ pkg/build/workflow_test.go | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/pkg/build/workflow.go b/pkg/build/workflow.go index 7eee572..a27e9ee 100644 --- a/pkg/build/workflow.go +++ b/pkg/build/workflow.go @@ -182,6 +182,10 @@ func isWorkflowDirectoryPath(path string) bool { return false } + if path == "." || path == "./" || path == ".\\" { + return true + } + last := path[len(path)-1] return last == '/' || last == '\\' } diff --git a/pkg/build/workflow_test.go b/pkg/build/workflow_test.go index eb8d09f..1b47dc7 100644 --- a/pkg/build/workflow_test.go +++ b/pkg/build/workflow_test.go @@ -124,6 +124,10 @@ func TestWorkflow_ResolveReleaseWorkflowPath_Good(t *testing.T) { assert.Equal(t, "/tmp/project/ci/release.yml", ResolveReleaseWorkflowPath("/tmp/project", "ci")) }) + t.Run("treats the current directory as a workflow directory", func(t *testing.T) { + assert.Equal(t, "/tmp/project/release.yml", ResolveReleaseWorkflowPath("/tmp/project", ".")) + }) + t.Run("treats trailing-slash relative paths as directories", func(t *testing.T) { assert.Equal(t, "/tmp/project/ci/release.yml", ResolveReleaseWorkflowPath("/tmp/project", "ci/")) }) @@ -156,6 +160,12 @@ func TestWorkflow_ResolveReleaseWorkflowInputPath_Good(t *testing.T) { assert.Equal(t, "/tmp/project/ci/release.yml", path) }) + t.Run("accepts the current directory as the primary input", func(t *testing.T) { + path, err := ResolveReleaseWorkflowInputPath("/tmp/project", ".", "") + require.NoError(t, err) + assert.Equal(t, "/tmp/project/release.yml", path) + }) + t.Run("accepts output as an alias for path", func(t *testing.T) { path, err := ResolveReleaseWorkflowInputPath("/tmp/project", "", "ci/release.yml") require.NoError(t, err)