From b622d9f86fdacbb8fc0d26aacf0c14ae905c3393 Mon Sep 17 00:00:00 2001 From: hervee Date: Wed, 24 Jun 2026 10:19:22 +0200 Subject: [PATCH 1/3] JGC-505 - Add checkout before install-go-with-cache in frogbot workflow --- .github/workflows/frogbot-scan-pull-request.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/frogbot-scan-pull-request.yml b/.github/workflows/frogbot-scan-pull-request.yml index 50a00670f..a3bd2afd8 100644 --- a/.github/workflows/frogbot-scan-pull-request.yml +++ b/.github/workflows/frogbot-scan-pull-request.yml @@ -8,6 +8,11 @@ jobs: scan-pull-request: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v7 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: Setup Go with cache uses: jfrog/.github/actions/install-go-with-cache@main From 01f23ce79eee6d6eaca04a6a1df05ac41850589c Mon Sep 17 00:00:00 2001 From: hervee Date: Wed, 24 Jun 2026 10:30:09 +0200 Subject: [PATCH 2/3] JGC-505 - Fix GITHUB_WORKFLOW env isolation in buildinfosummary test --- .../utils/commandsummary/buildinfosummary_test.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/artifactory/utils/commandsummary/buildinfosummary_test.go b/artifactory/utils/commandsummary/buildinfosummary_test.go index e7f31a64d..c1e927682 100644 --- a/artifactory/utils/commandsummary/buildinfosummary_test.go +++ b/artifactory/utils/commandsummary/buildinfosummary_test.go @@ -40,14 +40,11 @@ func (m *MockScanResult) GetVulnerabilities() string { func prepareBuildInfoTest(t *testing.T) (*BuildInfoSummary, func()) { // Set up test environment originalWorkflow := os.Getenv(workflowEnvKey) - if originalWorkflow == "" { - // this make the test pass locally - err := os.Setenv(workflowEnvKey, "JFrog CLI Core Tests") - require.NoError(t, err) - t.Cleanup(func() { - _ = os.Setenv(workflowEnvKey, originalWorkflow) - }) - } + err := os.Setenv(workflowEnvKey, "JFrog CLI Core Tests") + require.NoError(t, err) + t.Cleanup(func() { + _ = os.Setenv(workflowEnvKey, originalWorkflow) + }) // Mock the scan results defaults StaticMarkdownConfig.scanResultsMapping = make(map[string]ScanResult) StaticMarkdownConfig.scanResultsMapping[NonScannedResult] = &MockScanResult{ From 202d61b9e56e76db9ac3115b632837bc29926743 Mon Sep 17 00:00:00 2001 From: hervee Date: Wed, 24 Jun 2026 10:45:59 +0200 Subject: [PATCH 3/3] JGC-505 - Fix GITHUB_WORKFLOW env isolation in GenerateArtifactUrl test --- artifactory/utils/commandsummary/utils_test.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/artifactory/utils/commandsummary/utils_test.go b/artifactory/utils/commandsummary/utils_test.go index 3799ac215..0b2d49a10 100644 --- a/artifactory/utils/commandsummary/utils_test.go +++ b/artifactory/utils/commandsummary/utils_test.go @@ -16,16 +16,13 @@ const ( func TestGenerateArtifactUrl(t *testing.T) { // Set up test environment - originalWorklfow, exists := os.LookupEnv(workflowEnvKey) - if !exists { - // this make the test pass locally - err := os.Setenv(workflowEnvKey, "JFrog CLI Core Tests") + originalWorklfow := os.Getenv(workflowEnvKey) + err := os.Setenv(workflowEnvKey, "JFrog CLI Core Tests") + require.NoError(t, err) + t.Cleanup(func() { + err = os.Setenv(workflowEnvKey, originalWorklfow) require.NoError(t, err) - t.Cleanup(func() { - err = os.Setenv(workflowEnvKey, originalWorklfow) - require.NoError(t, err) - }) - } + }) cases := []struct { testName string