Fix CI test changed file detect issue (#618)
Signed-off-by: chensuyue <suyue.chen@intel.com>
This commit is contained in:
5
.github/workflows/_get-test-matrix.yml
vendored
5
.github/workflows/_get-test-matrix.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user