From e329a9cbb84ae9dad73d296f0b4e1492f7b4ddd2 Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Wed, 15 Jul 2026 15:01:09 -0400 Subject: [PATCH] fix: index cached tasks for PRs when tasks for is github-pull-request Bug: 2058130 --- src/taskgraph/util/cached_tasks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/taskgraph/util/cached_tasks.py b/src/taskgraph/util/cached_tasks.py index e24afc179..5c050745b 100644 --- a/src/taskgraph/util/cached_tasks.py +++ b/src/taskgraph/util/cached_tasks.py @@ -63,9 +63,9 @@ def add_optimization( # Pull requests use a different target cache index route. This way we can # be confident they won't be used by anything other than the pull request # that created the cache in the first place. - if config.params["tasks_for"].startswith( - "github-pull-request" - ) and config.graph_config["taskgraph"].get("cache-pull-requests", True): + if config.params["tasks_for"] == "github-pull-request" and config.graph_config[ + "taskgraph" + ].get("cache-pull-requests", True): subs["head_ref"] = config.params["head_ref"] if subs["head_ref"].startswith("refs/heads/"): subs["head_ref"] = subs["head_ref"][11:]