Skip to content

Commit c333172

Browse files
authored
Reorder checks in build docs action (#1506)
* Added print event job * Correct checks order for github.event * Dump GitHub context as action step
1 parent 6239281 commit c333172

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ jobs:
2929
with:
3030
access_token: ${{ github.token }}
3131

32+
- name: Dump GitHub context
33+
env:
34+
GITHUB_CONTEXT: ${{ toJson(github) }}
35+
run: |
36+
echo "$GITHUB_CONTEXT"
37+
3238
- name: Free Disk Space (Ubuntu)
3339
uses: jlumbroso/free-disk-space@main
3440
with:
@@ -115,7 +121,7 @@ jobs:
115121
# https://github.com/marketplace/actions/github-pages-action
116122
- name: Deploy docs
117123
if: |
118-
!github.event.pull_request.head.repo.fork &&
124+
github.event.pull_request && !github.event.pull_request.head.repo.fork &&
119125
(github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/'))
120126
uses: peaceiris/[email protected]
121127
with:
@@ -124,7 +130,7 @@ jobs:
124130

125131
- name: Publish pull-request docs
126132
if: |
127-
!github.event.pull_request.head.repo.fork && github.event.pull_request && github.event.action != 'closed'
133+
github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action != 'closed'
128134
uses: peaceiris/[email protected]
129135
with:
130136
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -139,7 +145,7 @@ jobs:
139145

140146
- name: Comment with URL to published pull-request docs
141147
if: |
142-
!github.event.pull_request.head.repo.fork && github.event.pull_request && github.event.action != 'closed'
148+
github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action != 'closed'
143149
env:
144150
PR_NUM: ${{ github.event.number }}
145151
uses: mshick/[email protected]
@@ -150,7 +156,7 @@ jobs:
150156

151157
clean:
152158
if: |
153-
!github.event.pull_request.head.repo.fork && github.event.pull_request && github.event.action == 'closed'
159+
github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action == 'closed'
154160
155161
needs: build-and-deploy
156162

0 commit comments

Comments
 (0)