Skip to content

Commit

Permalink
Add 3 dots to git diff to catch only the changed files at head (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
amzn-changml committed Sep 27, 2023
1 parent 6e7933c commit 2e1ee7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Get package and platform from JSON changes
id: detect-platform
run: |
CHANGED_FILES=$(git diff ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} --name-only)
CHANGED_FILES=$(git diff ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} --name-only)
# Construct the package and os into a json string to be consumed by Github Actions runners
JSON="{\"include\":["
for FILE in $CHANGED_FILES; do
Expand All @@ -47,8 +47,8 @@ jobs:
;;
esac
DIFF=$(git diff ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} --no-ext-diff --unified=0 \
--exit-code -a --no-prefix -- $FILE | egrep "^\+" | grep Scripts) # Get only the changes that can be built
DIFF=$(git diff ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} --no-ext-diff --unified=0 \
--exit-code -a --no-prefix -- $FILE | egrep "^\+" | grep Scripts) # Get oly the changes that can be built
if [[ $? -ne 0 ]]; then
echo No valid build change found. Exiting with non-zero
Expand Down

0 comments on commit 2e1ee7b

Please sign in to comment.