Skip to content

Commit 722a313

Browse files
committed
set base and head commit only when the event is a pr
1 parent f0e7e31 commit 722a313

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,14 @@ jobs:
136136
EXCLUDE_COMMIT: ${{ github.event.after }}
137137
run: python3 -u ci_changes_per_commit.py
138138
- name: Set base sha
139+
if: github.event_name == 'pull_request'
139140
run: |
140141
DEEPEN=$((DEPTH - $(git rev-list HEAD --count))) && if((DEEPEN > 0)); then git fetch --no-tags --recurse-submodules=no --deepen=$DEEPEN; fi
141142
echo "BASE_SHA=$(git rev-list $GITHUB_SHA --skip=$((DEPTH + 1)) --max-count=1)" >> $GITHUB_ENV
142143
env:
143144
DEPTH: ${{ steps.get-last-commit-with-checks.outputs.commit_depth || github.event.pull_request.commits }}
144145
- name: Set head sha
146+
if: github.event_name == 'pull_request'
145147
run: echo "HEAD_SHA=$(git rev-list $GITHUB_SHA --skip=1 --max-count=1)" >> $GITHUB_ENV
146148
- name: Get changes
147149
id: get-changes

0 commit comments

Comments
 (0)