Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gitea): allow overriding platform version #34019

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/usage/self-hosted-experimental.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ If set to any value, Renovate will download `nupkg` files for determining packag

## `RENOVATE_X_PLATFORM_VERSION`

Specify this string for Renovate to skip API checks and provide GitLab/Bitbucket server version directly.
Specify this string for Renovate to skip API checks and provide GitLab/Gitea and Forgejo/Bitbucket server version directly.
Particularly useful with GitLab's `CI_JOB_TOKEN` to authenticate Renovate or to reduce API calls for Bitbucket.

Read [platform details](modules/platform/gitlab/index.md) to learn why we need the server version on GitLab.
Expand Down
10 changes: 9 additions & 1 deletion lib/modules/platform/gitea/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,18 @@ const platform: Platform = {
gitAuthor = `${user.full_name ?? user.username} <${user.email}>`;
botUserID = user.id;
botUserName = user.username;
defaults.version = await helper.getVersion({ token });
// istanbul ignore if: experimental feature
if (semver.valid(process.env.RENOVATE_X_PLATFORM_VERSION)) {
defaults.version = process.env.RENOVATE_X_PLATFORM_VERSION!;
} else {
defaults.version = await helper.getVersion({ token });
}
if (defaults.version?.includes('gitea-')) {
defaults.isForgejo = true;
}
logger.debug(
`${defaults.isForgejo ? 'Forgejo' : 'Gitea'} version: ${defaults.version}`,
);
} catch (err) {
logger.debug(
{ err },
Expand Down