Fix CI test changed file detect issue (#618)

Signed-off-by: chensuyue <suyue.chen@intel.com>
This commit is contained in:
chen, suyue
2024-08-18 19:31:13 +08:00
committed by GitHub
parent 3363a37197
commit 5dcadf3d3f

View File

@@ -51,7 +51,10 @@ jobs:
run: | run: |
set -xe set -xe
if [ "${{ github.event_name }}" == "pull_request" ] || [ "${{ github.event_name }}" == "pull_request_target" ]; then 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 else
base_commit=$(git rev-parse HEAD~1) # push event base_commit=$(git rev-parse HEAD~1) # push event
fi fi