From 5b85a83aca8c4d767081262b1af7b31c8dfc5a39 Mon Sep 17 00:00:00 2001 From: Andrew Truong Date: Wed, 2 Oct 2024 16:22:46 -0400 Subject: [PATCH] test --- .../workflows/check-which-tests-to-run.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check-which-tests-to-run.yaml b/.github/workflows/check-which-tests-to-run.yaml index 8a4fcd18f0a..93d8a045441 100644 --- a/.github/workflows/check-which-tests-to-run.yaml +++ b/.github/workflows/check-which-tests-to-run.yaml @@ -32,14 +32,16 @@ jobs: ref: ${{ github.head_ref }} - name: Git setup run: | - git fetch origin ${{ github.base_ref }} - if [ "${{ github.event_name }}" = "pull_request" ]; then - base_sha=$(git rev-parse origin/${{ github.base_ref }}) - head_sha=$(git rev-parse HEAD) - changed_files=$(git diff --name-only $base_sha $head_sha) - else - changed_files=$(git diff --name-only HEAD^) - fi + git fetch --all + - run: | + git checkout ${{ github.head_ref || github.ref_name}} + - run: | + changed_files=$(git diff --name-only $(git merge-base --fork-point origin/master HEAD) HEAD) + echo "Changed files:" + echo "$changed_files" + echo "changed_files<> $GITHUB_ENV + echo "$changed_files" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV - id: weave_query name: Weave Query Checks run: |