From aa598b88073df268c45ffdba86294770dcd79778 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 14 Nov 2025 16:29:58 +0000 Subject: [PATCH 1/4] Initial plan From c952d3b268edef3ad31b71e946451c1463a6bd12 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 14 Nov 2025 16:37:16 +0000 Subject: [PATCH 2/4] Initial investigation of actions-lock.json cleanup issue Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/super-linter.lock.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/super-linter.lock.yml b/.github/workflows/super-linter.lock.yml index 255d1dc1430..f9d8f5faec9 100644 --- a/.github/workflows/super-linter.lock.yml +++ b/.github/workflows/super-linter.lock.yml @@ -4569,7 +4569,7 @@ jobs: fi - name: Upload super-linter log if: always() - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 with: name: super-linter-log path: super-linter.log From 8fff14a6b12d7ea1d867a12a7d284f08b9e8727c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 14 Nov 2025 16:46:10 +0000 Subject: [PATCH 3/4] Add cleanup for actions-lock.json in test suite Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/cli/compile_integration_test.go | 7 +++++++ pkg/cli/test_main_test.go | 29 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 pkg/cli/test_main_test.go diff --git a/pkg/cli/compile_integration_test.go b/pkg/cli/compile_integration_test.go index ed0b63003f3..6b1cb4931a3 100644 --- a/pkg/cli/compile_integration_test.go +++ b/pkg/cli/compile_integration_test.go @@ -66,6 +66,13 @@ func TestMain(m *testing.M) { os.RemoveAll(filepath.Dir(globalBinaryPath)) } + // Clean up any action cache files created during tests + // Tests may create .github/aw/actions-lock.json in the pkg/cli directory + actionCacheDir := filepath.Join(wd, ".github") + if _, err := os.Stat(actionCacheDir); err == nil { + _ = os.RemoveAll(actionCacheDir) + } + os.Exit(code) } diff --git a/pkg/cli/test_main_test.go b/pkg/cli/test_main_test.go new file mode 100644 index 00000000000..e80a4786032 --- /dev/null +++ b/pkg/cli/test_main_test.go @@ -0,0 +1,29 @@ +package cli + +import ( + "os" + "path/filepath" + "testing" +) + +// TestMain provides setup and teardown for unit tests in the cli package +// Note: Integration tests have their own TestMain in compile_integration_test.go +func TestMain(m *testing.M) { + // Get current working directory before tests run + wd, err := os.Getwd() + if err != nil { + panic("Failed to get current working directory: " + err.Error()) + } + + // Run all tests + code := m.Run() + + // Clean up any action cache files created during tests + // Tests may create .github/aw/actions-lock.json in the pkg/cli directory + actionCacheDir := filepath.Join(wd, ".github") + if _, err := os.Stat(actionCacheDir); err == nil { + _ = os.RemoveAll(actionCacheDir) + } + + os.Exit(code) +} From fbc76cdc615a04235c0a45a0c3e4d123a62f88f3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 14 Nov 2025 16:48:49 +0000 Subject: [PATCH 4/4] Add build constraint to prevent TestMain conflict Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/cli/test_main_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/cli/test_main_test.go b/pkg/cli/test_main_test.go index e80a4786032..c93b0fbb85c 100644 --- a/pkg/cli/test_main_test.go +++ b/pkg/cli/test_main_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package cli import (