File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -31,12 +31,20 @@ jobs:
3131 # Fetch commit refs.
3232 first="0000000000000000000000000000000000000000"
3333
34- if [[ ${{ github.event_name }} == 'push' && ${{ github.event.before }} == $first ]]; then
35- echo "This is the first commit in the repository. No commits to check."
36- echo "skip_pre-commit=true" >> $GITHUB_OUTPUT
37- elif [[ ${{ github.event_name }} == 'pull_request' && $(git rev-parse origin/${{ github.base_ref }}) == $first ]]; then
38- echo "This is the first commit in the repository. No commits to check."
39- echo "skip_pre-commit=true" >> $GITHUB_OUTPUT
34+ if [[ ${{ github.event_name }} == 'push' ]]; then
35+ if [[ ${{ github.event.before }} == $first ]]; then
36+ echo "This is the first commit in the repository. No commits to check."
37+ echo "skip_pre-commit=true" >> $GITHUB_OUTPUT
38+ else
39+ echo "skip_pre-commit=false" >> $GITHUB_OUTPUT
40+ fi
41+ elif [[ ${{ github.event_name }} == 'pull_request' ]]; then
42+ if [[ $(git rev-parse origin/${{ github.base_ref }}) == $first ]];then
43+ echo "This is the first commit in the repository. No commits to check."
44+ echo "skip_pre-commit=true" >> $GITHUB_OUTPUT
45+ else
46+ echo "skip_pre-commit=false" >> $GITHUB_OUTPUT
47+ fi
4048 else
4149 echo "skip_pre-commit=false" >> $GITHUB_OUTPUT
4250 fi
You can’t perform that action at this time.
0 commit comments