Skip to content

Commit

Permalink
ci: Use ... diff in list-changed-projects.sh (#25885)
Browse files Browse the repository at this point in the history
The base ref passed from GitHub is the tip of the target branch, not the
merge-base with the current PR. `git diff base..head` will wind up
showing a diff that reverses any changes between the merge-base and the
passed base; the behavior we want is `git diff base...head`.
  • Loading branch information
anomiex authored Aug 29, 2022
1 parent 4883758 commit 3d36395
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/files/list-changed-projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ARGS=( --add-dependents )

if [[ "${GITHUB_EVENT_NAME:?}" == "pull_request" ]]; then
[[ -f "${GITHUB_EVENT_PATH:?}" ]] || die "GITHUB_EVENT_PATH file $GITHUB_EVENT_PATH does not exist"
DIFF="$(jq -r '"\( .pull_request.base.sha )..\( .pull_request.head.sha )"' "$GITHUB_EVENT_PATH")"
DIFF="$(jq -r '"\( .pull_request.base.sha )...\( .pull_request.head.sha )"' "$GITHUB_EVENT_PATH")"
debug "GITHUB_EVENT_NAME is pull_request, checking diff from $DIFF"
ARGS+=( --verbose "--git-changed=$DIFF" )
elif [[ "${GITHUB_EVENT_NAME:?}" == "push" ]]; then
Expand Down

0 comments on commit 3d36395

Please sign in to comment.