From ffc63c35c230d8280a00971ef95165bd3e17303a Mon Sep 17 00:00:00 2001
From: Sergei Zharinov <zharinov@users.noreply.github.com>
Date: Mon, 26 Sep 2022 13:59:49 +0300
Subject: [PATCH] fix(github): Update long-term GitHub cache during run
 (#17972)

---
 lib/modules/platform/github/index.ts | 3 ++-
 lib/modules/platform/github/pr.ts    | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/modules/platform/github/index.ts b/lib/modules/platform/github/index.ts
index 5a3bcab757..8f448afa89 100644
--- a/lib/modules/platform/github/index.ts
+++ b/lib/modules/platform/github/index.ts
@@ -65,7 +65,7 @@ import {
   vulnerabilityAlertsQuery,
 } from './graphql';
 import { massageMarkdownLinks } from './massage-markdown-links';
-import { getPrCache } from './pr';
+import { getPrCache, updatePrCache } from './pr';
 import type {
   BranchProtection,
   CombinedBranchStatus,
@@ -569,6 +569,7 @@ export async function getRepoForceRebase(): Promise<boolean> {
 function cachePr(pr?: GhPr | null): void {
   config.prList ??= [];
   if (pr) {
+    updatePrCache(pr);
     for (let idx = 0; idx < config.prList.length; idx += 1) {
       const cachedPr = config.prList[idx];
       if (cachedPr.number === pr.number) {
diff --git a/lib/modules/platform/github/pr.ts b/lib/modules/platform/github/pr.ts
index f1064b875f..ac8c011692 100644
--- a/lib/modules/platform/github/pr.ts
+++ b/lib/modules/platform/github/pr.ts
@@ -140,3 +140,8 @@ export async function getPrCache(
 
   return prApiCache.getItems();
 }
+
+export function updatePrCache(pr: GhPr): void {
+  const cache = getPrApiCache();
+  cache.updateItem(pr);
+}
-- 
GitLab