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 11import platform
2+ import os
23import sys
34import traceback
45from typing import Dict
@@ -359,7 +360,12 @@ def _check_db(workflow):
359360 )
360361 )
361362
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+ ):
363369 print ("Filter not affected jobs" )
364370
365371 def check_affected_jobs ():
@@ -440,6 +446,11 @@ def check_affected_jobs():
440446 )
441447
442448 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+
443454 print ("Cache Lookup" )
444455 stop_watch = Utils .Stopwatch ()
445456 info = ""
You can’t perform that action at this time.
0 commit comments