File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 67
67
run : echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
68
68
- name : Set base sha (pull)
69
69
if : github.event_name == 'pull_request'
70
- run : |
71
- git fetch --no-tags --no-recurse-submodules --depth=$((DEPTH + 1)) origin $HEAD_SHA
72
- echo "BASE_SHA=$(git rev-list $HEAD_SHA --skip=$DEPTH --max-count=1)" >> $GITHUB_ENV
70
+ run : git cat-file -e $SHA && echo "BASE_SHA=$SHA" >> $GITHUB_ENV || true
73
71
env :
74
- DEPTH : ${{ steps.get-last-commit-with-checks.outputs.commit_depth || github.event.pull_request.commits }}
72
+ SHA : ${{ steps.get-last-commit-with-checks.outputs.commit_sha || github.event.pull_request.base.sha }}
75
73
- name : Set head sha (push)
76
74
if : github.event_name == 'push'
77
75
run : echo "HEAD_SHA=${{ github.event.after }}" >> $GITHUB_ENV
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ def git_diff(pattern: str):
89
89
print ("Using files list by computing diff" )
90
90
changed_files = git_diff ("$BASE_SHA...$HEAD_SHA" )
91
91
if os .environ .get ("GITHUB_EVENT_NAME" ) == "pull_request" :
92
- changed_files .intersection_update (git_diff ("$HEAD_SHA ~...$HEAD_SHA " ))
92
+ changed_files .intersection_update (git_diff ("$GITHUB_SHA ~...$GITHUB_SHA " ))
93
93
else :
94
94
print ("Using files list in CHANGED_FILES" )
95
95
changed_files = set (json .loads (os .environ .get ("CHANGED_FILES" ) or "[]" ))
You can’t perform that action at this time.
0 commit comments