-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Handle cases when
BASE
SHA isn't known - push
events
If the first commit is pushed to a new branch, `${{ github.event.before }}` has a default value of `0000000000000000000000000000000000000000`. When we detect such SHA, we should try to get older `BASE` SHA from the `HEAD` branch if possible. Inspired by: * [How can I get the previous commit before a push or merge in GitHub Action workflow? - Answered by Peter Evans](https://stackoverflow.com/a/61861763/10221282) * [tj-actions/changed-files GitHub Action](https://github.com/tj-actions/changed-files/blob/main/diff-sha.sh#L116-L118)
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters