From 4ccf4fa97df2971fb60efe2456c600d173d698df Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:42:10 -0400 Subject: [PATCH] ci: don't call datadog test logging on forks (#44194) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt --- .github/workflows/pipeline-segment-electron-test.yml | 5 ++++- appveyor-woa.yml | 2 +- appveyor.yml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pipeline-segment-electron-test.yml b/.github/workflows/pipeline-segment-electron-test.yml index e6ad35eeded3..1dd629a50948 100644 --- a/.github/workflows/pipeline-segment-electron-test.yml +++ b/.github/workflows/pipeline-segment-electron-test.yml @@ -197,7 +197,10 @@ jobs: DD_API_KEY: ${{ secrets.DD_API_KEY }} DD_CIVISIBILITY_LOGS_ENABLED: true DD_TAGS: "os.architecture:${{ inputs.target-arch }},os.family:${{ inputs.target-platform }},os.platform:${{ inputs.target-platform }},asan:${{ inputs.is-asan }}" - run: datadog-ci junit upload src/electron/junit/test-results-main.xml + run: | + if ! [ -z $DD_API_KEY ]; then + datadog-ci junit upload src/electron/junit/test-results-main.xml + fi if: always() && !cancelled() - name: Wait for active SSH sessions if: always() && !cancelled() diff --git a/appveyor-woa.yml b/appveyor-woa.yml index ad79dde273da..660f1528b389 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -334,7 +334,7 @@ for: # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - if exist electron\junit\test-results-main.xml ( appveyor-retry appveyor PushArtifact electron\junit\test-results-main.xml ) - ps: | - if ($env:RUN_TESTS -eq 'true') { + if ($env:DD_API_KEY) { $env:DD_GIT_COMMIT_SHA = $env:APPVEYOR_REPO_COMMIT $env:DD_GIT_BRANCH = $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH $env:DD_TAGS = "os.architecture:$env:TARGET_ARCH,os.family:windows,os.platform:win32" diff --git a/appveyor.yml b/appveyor.yml index 4bb416d0217d..4a249c01ba56 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -329,7 +329,7 @@ for: # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - if exist electron\junit\test-results-main.xml ( appveyor-retry appveyor PushArtifact electron\junit\test-results-main.xml ) - ps: | - if ($env:RUN_TESTS -eq 'true') { + if ($env:RUN_TESTS -eq 'true' -And $env:DD_API_KEY) { $env:DD_GIT_COMMIT_SHA = $env:APPVEYOR_REPO_COMMIT $env:DD_GIT_BRANCH = $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH $env:DD_TAGS = "os.architecture:$env:TARGET_ARCH,os.family:windows,os.platform:win32"