@@ -26,18 +26,20 @@ concurrency:
2626  cancel-in-progress : true 
2727
2828jobs :
29+   skip-schedule-on-fork :
30+     name : Check for schedule trigger on fork 
31+     runs-on : ubuntu-latest 
32+     #  if 'schedule' was the trigger,
33+     #  don't run it on contributors' forks
34+     if : >- 
35+       github.repository == 'python/typing_extensions' 
36+       || github.event_name != 'schedule' 
37+ steps :
38+       - run : true 
39+ 
2940  pydantic :
3041    name : pydantic tests 
31-     if : >- 
32-       # if 'schedule' was the trigger, 
33-       # don't run it on contributors' forks 
34-       ${{ 
35-         github.event_name != 'schedule' 
36-         || ( 
37-           github.repository == 'python/typing_extensions' 
38-           && github.event_name == 'schedule' 
39-         ) 
40-       }} 
42+     needs : skip-schedule-on-fork 
4143    strategy :
4244      fail-fast : false 
4345      matrix :
7274
7375  typing_inspect :
7476    name : typing_inspect tests 
75-     if : >- 
76-       # if 'schedule' was the trigger, 
77-       # don't run it on contributors' forks 
78-       ${{ 
79-         github.event_name != 'schedule' 
80-         || ( 
81-           github.repository == 'python/typing_extensions' 
82-           && github.event_name == 'schedule' 
83-         ) 
84-       }} 
77+     needs : skip-schedule-on-fork 
8578    strategy :
8679      fail-fast : false 
8780      matrix :
@@ -117,16 +110,7 @@ jobs:
117110
118111pyanalyze :
119112    name : pyanalyze tests 
120-     if : >- 
121-       # if 'schedule' was the trigger, 
122-       # don't run it on contributors' forks 
123-       ${{ 
124-         github.event_name != 'schedule' 
125-         || ( 
126-           github.repository == 'python/typing_extensions' 
127-           && github.event_name == 'schedule' 
128-         ) 
129-       }} 
113+     needs : skip-schedule-on-fork 
130114    strategy :
131115      fail-fast : false 
132116      matrix :
@@ -163,16 +147,7 @@ jobs:
163147
164148typeguard :
165149    name : typeguard tests 
166-     if : >- 
167-       # if 'schedule' was the trigger, 
168-       # don't run it on contributors' forks 
169-       ${{ 
170-         github.event_name != 'schedule' 
171-         || ( 
172-           github.repository == 'python/typing_extensions' 
173-           && github.event_name == 'schedule' 
174-         ) 
175-       }} 
150+     needs : skip-schedule-on-fork 
176151    strategy :
177152      fail-fast : false 
178153      matrix :
@@ -210,16 +185,7 @@ jobs:
210185
211186typed-argument-parser :
212187    name : typed-argument-parser tests 
213-     if : >- 
214-       # if 'schedule' was the trigger, 
215-       # don't run it on contributors' forks 
216-       ${{ 
217-         github.event_name != 'schedule' 
218-         || ( 
219-           github.repository == 'python/typing_extensions' 
220-           && github.event_name == 'schedule' 
221-         ) 
222-       }} 
188+     needs : skip-schedule-on-fork 
223189    strategy :
224190      fail-fast : false 
225191      matrix :
@@ -262,16 +228,7 @@ jobs:
262228
263229mypy :
264230    name : stubtest & mypyc tests 
265-     if : >- 
266-       # if 'schedule' was the trigger, 
267-       # don't run it on contributors' forks 
268-       ${{ 
269-         github.event_name != 'schedule' 
270-         || ( 
271-           github.repository == 'python/typing_extensions' 
272-           && github.event_name == 'schedule' 
273-         ) 
274-       }} 
231+     needs : skip-schedule-on-fork 
275232    strategy :
276233      fail-fast : false 
277234      matrix :
@@ -309,16 +266,7 @@ jobs:
309266
310267cattrs :
311268    name : cattrs tests 
312-     if : >- 
313-       # if 'schedule' was the trigger, 
314-       # don't run it on contributors' forks 
315-       ${{ 
316-         github.event_name != 'schedule' 
317-         || ( 
318-           github.repository == 'python/typing_extensions' 
319-           && github.event_name == 'schedule' 
320-         ) 
321-       }} 
269+     needs : skip-schedule-on-fork 
322270    strategy :
323271      fail-fast : false 
324272      matrix :
0 commit comments