From e11f9d9882395deaf5fbbb81b3327cb8c2ef069c Mon Sep 17 00:00:00 2001 From: RahulGautamSingh <rahultesnik@gmail.com> Date: Wed, 12 Jun 2024 12:38:55 +0545 Subject: [PATCH] fix(github): fetch all open issue if ignorePrAuthor=true (#29485) Co-authored-by: Rhys Arkins <rhys@arkins.net> --- docs/usage/configuration-options.md | 2 +- lib/modules/platform/github/graphql.ts | 2 +- lib/modules/platform/github/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 7bca3ce841..33b15852f6 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -2065,7 +2065,7 @@ An additional use case is for GitLab users of project or group access tokens who If `ignorePrAuthor` is configured to true, it means Renovate will fetch the entire list of repository PRs instead of optimizing to fetch only those PRs which it created itself. You should only want to enable this if you are changing the bot account (e.g. from `@old-bot` to `@new-bot`) and want `@new-bot` to find and update any existing PRs created by `@old-bot`. -Setting this field to `true` in GitLab will also mean that all Issues will be fetched instead of only those by the bot itself. +Setting this field to `true` in Github or GitLab will also mean that all Issues will be fetched instead of only those by the bot itself. ## ignorePresets diff --git a/lib/modules/platform/github/graphql.ts b/lib/modules/platform/github/graphql.ts index 3931dd47d5..6e877aeea4 100644 --- a/lib/modules/platform/github/graphql.ts +++ b/lib/modules/platform/github/graphql.ts @@ -41,7 +41,7 @@ export const getIssuesQuery = ` query( $owner: String!, $name: String!, - $user: String!, + $user: String, $count: Int, $cursor: String ) { diff --git a/lib/modules/platform/github/index.ts b/lib/modules/platform/github/index.ts index a0873b7d0c..764e6fe33f 100644 --- a/lib/modules/platform/github/index.ts +++ b/lib/modules/platform/github/index.ts @@ -1214,7 +1214,7 @@ async function getIssues(): Promise<Issue[]> { variables: { owner: config.repositoryOwner, name: config.repositoryName, - user: config.renovateUsername, + ...(!config.ignorePrAuthor && { user: config.renovateUsername }), }, readOnly: true, }, -- GitLab