From cd83854f93423a2327f07430fbf781e6f879ce41 Mon Sep 17 00:00:00 2001 From: "chen, suyue" Date: Sun, 18 Aug 2024 19:30:51 +0800 Subject: [PATCH] Fix CI test changed file detect issue (#512) * update wf Signed-off-by: chensuyue * for test Signed-off-by: chensuyue * remove test code Signed-off-by: chensuyue --------- Signed-off-by: chensuyue --- .github/workflows/_get-test-matrix.yml | 5 ++++- .github/workflows/pr-examples-test.yml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) 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: