diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 53ec1d3..c085c4a 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -15,8 +15,10 @@ jobs: - name: Get changed files id: changed-files run: | - # Get the list of files that were changed between the base branch and the current commit - CHANGED_FILES=$(git diff --name-only origin/$GITHUB_BASE_REF...HEAD | grep "^packages/**") + # Get the merge base (common ancestor) of the PR + MERGE_BASE=$(git merge-base origin/${{ github.base_ref }} HEAD) + # only valid for PRs + CHANGED_FILES=$(git diff --name-only $MERGE_BASE | grep "^packages/**") if echo "$CHANGED_FILES"; then echo "any_changed=true" >> $GITHUB_OUTPUT