Skip to content

Commit b36c777

Browse files
committed
Correct checks order for github.event
1 parent 3ad5159 commit b36c777

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defaults:
1616
jobs:
1717
print:
1818
name: Print event
19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-20.04
2020
steps:
2121
- name: Dump GitHub context
2222
env:
@@ -125,7 +125,7 @@ jobs:
125125
# https://github.com/marketplace/actions/github-pages-action
126126
- name: Deploy docs
127127
if: |
128-
!github.event.pull_request.head.repo.fork &&
128+
github.event.pull_request && !github.event.pull_request.head.repo.fork &&
129129
(github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/'))
130130
uses: peaceiris/[email protected]
131131
with:
@@ -134,7 +134,7 @@ jobs:
134134

135135
- name: Publish pull-request docs
136136
if: |
137-
!github.event.pull_request.head.repo.fork && github.event.pull_request && github.event.action != 'closed'
137+
github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action != 'closed'
138138
uses: peaceiris/[email protected]
139139
with:
140140
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -149,7 +149,7 @@ jobs:
149149

150150
- name: Comment with URL to published pull-request docs
151151
if: |
152-
!github.event.pull_request.head.repo.fork && github.event.pull_request && github.event.action != 'closed'
152+
github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action != 'closed'
153153
env:
154154
PR_NUM: ${{ github.event.number }}
155155
uses: mshick/[email protected]
@@ -160,7 +160,7 @@ jobs:
160160

161161
clean:
162162
if: |
163-
!github.event.pull_request.head.repo.fork && github.event.pull_request && github.event.action == 'closed'
163+
github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action == 'closed'
164164
165165
needs: build-and-deploy
166166

0 commit comments

Comments
 (0)