ci: fix commit range in push event (#29755)

* fix commit range

* use github.event.before instead of HEAD~1
This commit is contained in:
Yihau Chen 2023-01-19 12:28:00 +08:00 committed by GitHub
parent c4e43f1de4
commit e7838768ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ jobs:
- name: Get commit range (push)
if: ${{ github.event_name == 'push' }}
run: |
echo "COMMIT_RANGE=$GITHUB_SHA" >> $GITHUB_ENV
echo "COMMIT_RANGE=${{ github.event.before }}..$GITHUB_SHA" >> $GITHUB_ENV
- name: Get commit range (pull_request)
if: ${{ github.event_name == 'pull_request' }}

View File

@ -26,7 +26,7 @@ jobs:
- name: Get commit range (push)
if: ${{ github.event_name == 'push' }}
run: |
echo "COMMIT_RANGE=$GITHUB_SHA" >> $GITHUB_ENV
echo "COMMIT_RANGE=${{ github.event.before }}..$GITHUB_SHA" >> $GITHUB_ENV
- name: Get commit range (pull_request)
if: ${{ github.event_name == 'pull_request' }}