From df9cbe00db70f2d55545c67b469100297d9c38c7 Mon Sep 17 00:00:00 2001 From: Robi Nino Date: Wed, 4 Sep 2024 21:53:16 +0300 Subject: [PATCH] Fix connection check (#205) --- .github/workflows/auto-build-publish-test.yml | 2 ++ lib/cleanup.js | 2 +- src/cleanup.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-build-publish-test.yml b/.github/workflows/auto-build-publish-test.yml index 2fd6ea54..4b96301d 100644 --- a/.github/workflows/auto-build-publish-test.yml +++ b/.github/workflows/auto-build-publish-test.yml @@ -24,6 +24,8 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Setup Go with cache uses: jfrog/.github/actions/install-go-with-cache@main diff --git a/lib/cleanup.js b/lib/cleanup.js index e9309016..0f6c2514 100644 --- a/lib/cleanup.js +++ b/lib/cleanup.js @@ -158,7 +158,7 @@ function checkConnectionToArtifactory() { try { core.startGroup('Checking connection to JFrog Artifactory'); const pingResult = yield utils_1.Utils.runCliAndGetOutput(['rt', 'ping']); - if (pingResult !== 'OK') { + if (pingResult.trim() !== 'OK') { core.debug(`Ping result: ${pingResult}`); core.warning('Could not connect to Artifactory. Skipping Build Info post tasks.'); return false; diff --git a/src/cleanup.ts b/src/cleanup.ts index a93ee45d..83ca4d91 100644 --- a/src/cleanup.ts +++ b/src/cleanup.ts @@ -124,7 +124,7 @@ async function checkConnectionToArtifactory(): Promise { try { core.startGroup('Checking connection to JFrog Artifactory'); const pingResult: string = await Utils.runCliAndGetOutput(['rt', 'ping']); - if (pingResult !== 'OK') { + if (pingResult.trim() !== 'OK') { core.debug(`Ping result: ${pingResult}`); core.warning('Could not connect to Artifactory. Skipping Build Info post tasks.'); return false;