Skip to content

Commit 44d83cc

Browse files
[PRM-227] Fixed get_changes ci step
1 parent 1563e0a commit 44d83cc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/service-ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,13 @@ jobs:
4747
- name: Get Changes
4848
id: get_changes
4949
run: |
50-
git fetch origin ${{ github.event.pull_request.base.ref }}
51-
changed=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD | tr '\n' ' ')
50+
if [ "${{ github.event_name }}" == "pull_request" ]; then
51+
git fetch origin ${{ github.event.pull_request.base.ref }}
52+
BASE="origin/${{ github.event.pull_request.base.ref }}"
53+
else
54+
BASE="HEAD~1"
55+
fi
56+
changed=$(git diff --name-only $BASE...HEAD | tr '\n' ' ')
5257
echo "changed=$changed" >> $GITHUB_OUTPUT
5358
5459
ehr-repo:

0 commit comments

Comments
 (0)