diff --git a/.github/workflows/integration-test-workflow.yml b/.github/workflows/integration-test-workflow.yml index c88ac20..2202cbb 100644 --- a/.github/workflows/integration-test-workflow.yml +++ b/.github/workflows/integration-test-workflow.yml @@ -55,7 +55,11 @@ jobs: - name: Verify default Push Workflow if: ${{ github.event_name != 'pull_request' }} run: | - BASE_SHA=$(echo $(git rev-parse HEAD~1)) + if git merge-base --is-ancestor $NX_BASE HEAD; then + BASE_SHA=$NX_BASE; + else + BASE_SHA=""; + fi HEAD_SHA=$(echo $(git rev-parse HEAD)) node -e "if(process.env.NX_BASE == '${BASE_SHA}') console.log('Base set correctly'); else { throw new Error('Base not set correctly!');}" node -e "if(process.env.NX_HEAD == '${HEAD_SHA}') console.log('Head set correctly'); else { throw new Error('Head not set correctly!');}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1fe5d22..baf4166 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,7 +68,11 @@ jobs: if: github.event_name != 'pull_request' shell: bash run: | - BASE_SHA=$(echo $(git rev-parse HEAD~1)) + if git merge-base --is-ancestor $NX_BASE HEAD; then + BASE_SHA=$NX_BASE; + else + BASE_SHA=""; + fi HEAD_SHA=$(echo $(git rev-parse HEAD)) node -e "if(process.env.NX_BASE == '${BASE_SHA}') console.log('Base set correctly'); else { throw new Error('Base not set correctly!');}" node -e "if(process.env.NX_HEAD == '${HEAD_SHA}') console.log('Head set correctly'); else { throw new Error('Head not set correctly!');}"