diff --git a/.github/workflows/auto-build-publish-test.yml b/.github/workflows/auto-build-publish-test.yml index 2fd6ea549..4b96301d4 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 e93090165..0f6c25147 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 a93ee45d9..83ca4d918 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;