File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
import platform
2
+ import os
2
3
import sys
3
4
import traceback
4
5
from typing import Dict
@@ -359,7 +360,12 @@ def _check_db(workflow):
359
360
)
360
361
)
361
362
362
- if workflow .enable_job_filtering_by_changes and results [- 1 ].is_ok ():
363
+ pr_allows_cache = "[x] <!---no_ci_cache" not in Info ().pr_body
364
+ if (
365
+ workflow .enable_job_filtering_by_changes
366
+ and results [- 1 ].is_ok ()
367
+ and pr_allows_cache
368
+ ):
363
369
print ("Filter not affected jobs" )
364
370
365
371
def check_affected_jobs ():
@@ -440,6 +446,11 @@ def check_affected_jobs():
440
446
)
441
447
442
448
if results [- 1 ].is_ok () and workflow .enable_cache :
449
+ # We can't safely skip this code block entirely if enable_cache=True is set at the workflow level
450
+ # set DISABLE_CI_CACHE=1 to signal that the cache should be skipped
451
+ if not pr_allows_cache :
452
+ os .environ ["DISABLE_CI_CACHE" ] = "1"
453
+
443
454
print ("Cache Lookup" )
444
455
stop_watch = Utils .Stopwatch ()
445
456
info = ""
You can’t perform that action at this time.
0 commit comments