diff --git a/prelude/decls/git_rules.bzl b/prelude/decls/git_rules.bzl index 070945e76929d..1e5a41d9dffd8 100644 --- a/prelude/decls/git_rules.bzl +++ b/prelude/decls/git_rules.bzl @@ -25,6 +25,9 @@ git_fetch = prelude_rule( attrs = ( # @unsorted-dict-items { + "allow_cache_upload": attrs.bool(doc = """ + Whether the results of the fetch can be written to the action cache and CAS. + """, default = True), "repo": attrs.string(doc = """ Url suitable as a git remote. """), diff --git a/prelude/git/git_fetch.bzl b/prelude/git/git_fetch.bzl index 3b266ab730300..8d93ed6167873 100644 --- a/prelude/git/git_fetch.bzl +++ b/prelude/git/git_fetch.bzl @@ -39,6 +39,7 @@ def git_fetch_impl(ctx: AnalysisContext) -> list[Provider]: cmd, category = "git_fetch", local_only = True, + allow_cache_upload = ctx.attrs.allow_cache_upload, ) return [DefaultInfo(default_output = work_tree)]