diff --git a/.github/workflows/_get-test-matrix.yml b/.github/workflows/_get-test-matrix.yml index 09be978cb..deedaa949 100644 --- a/.github/workflows/_get-test-matrix.yml +++ b/.github/workflows/_get-test-matrix.yml @@ -38,7 +38,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/GenAIComps/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 diff --git a/.github/workflows/pr-examples-test.yml b/.github/workflows/pr-examples-test.yml index 302d6f8e1..a3eb50539 100644 --- a/.github/workflows/pr-examples-test.yml +++ b/.github/workflows/pr-examples-test.yml @@ -16,6 +16,7 @@ on: - comps/llms/text-generation/tgi/** - comps/dataprep/redis/langchain/** - requirements.txt + - "!**.md" # If there is a new commit, the previous jobs will be canceled concurrency: