diff --git a/lib/modules/manager/bazel/__snapshots__/extract.spec.ts.snap b/lib/modules/manager/bazel/__snapshots__/extract.spec.ts.snap index d17b3e86a036f7..e7064c344682ef 100644 --- a/lib/modules/manager/bazel/__snapshots__/extract.spec.ts.snap +++ b/lib/modules/manager/bazel/__snapshots__/extract.spec.ts.snap @@ -95,7 +95,7 @@ exports[`modules/manager/bazel/extract extractPackageFile() extracts multiple ty }, { "currentDigest": "b3b620e8bcff18ed3378cd3f35ebeb7016d71f71", - "datasource": "github-releases", + "datasource": "github-tags", "depName": "com_github_bazelbuild_buildtools", "depType": "git_repository", "managerData": { diff --git a/lib/modules/manager/bazel/rules/git.ts b/lib/modules/manager/bazel/rules/git.ts index 5779a67bac1782..357b4f4b3a0a35 100644 --- a/lib/modules/manager/bazel/rules/git.ts +++ b/lib/modules/manager/bazel/rules/git.ts @@ -4,6 +4,7 @@ import { logger } from '../../../../logger'; import { regEx } from '../../../../util/regex'; import { GithubReleasesDatasource } from '../../../datasource/github-releases'; import type { PackageDependency } from '../../types'; +import { GithubTagsDatasource } from '../../../datasource/github-tags'; const githubUrlRegex = regEx( /^https:\/\/github\.com\/(?[^/]+\/[^/]+)/, @@ -44,8 +45,12 @@ export const GitTarget = z const githubPackage = githubPackageName(remote); if (githubPackage) { - dep.datasource = GithubReleasesDatasource.id; dep.packageName = githubPackage; + if (dep.currentValue) { + dep.datasource = GithubReleasesDatasource.id; + } else { + dep.datasource = GithubTagsDatasource.id; + } } if (!dep.datasource) {