diff --git a/.github/workflows/_get-test-matrix.yml b/.github/workflows/_get-test-matrix.yml index 12f7ed835..999767f13 100644 --- a/.github/workflows/_get-test-matrix.yml +++ b/.github/workflows/_get-test-matrix.yml @@ -51,7 +51,10 @@ jobs: run: | set -xe if [ "${{ github.event_name }}" == "pull_request" ] || [ "${{ github.event_name }}" == "pull_request_target" ]; then - base_commit=${{ github.event.pull_request.base.sha }} + LATEST_COMMIT_SHA=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/opea-project/GenAIExamples/commits?sha=main" | jq -r '.[0].sha') + echo "Latest commit SHA is $LATEST_COMMIT_SHA" + base_commit=$LATEST_COMMIT_SHA else base_commit=$(git rev-parse HEAD~1) # push event fi