mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-01 10:09:50 +00:00
fe649335ce
While looking at the fix for `actions/setup-java`, we noticed that `actions/setup-dotnet` may also be affected, as it notes: > - **A.B** or **A.B.x** installs the latest patch version of .NET SDK > on the channel > - **A** or **A.x** installs the latest minor version of the specified > major tag alongside `A.B.Cxx` for "the latest version of the specific SDK release" and `latest` for "the highest active .NET SDK version". As these fall back to `semver-coerced`, which happily coerces `8.0.x` to `8.0.0`, Renovate then raises a PR to bump to a full version such as `9.0.100`, which isn't the intent. Rather than the `semver-partial` versioning used for the other Actions, here we can use `npm` versioning, which understands the x-range form too, and safely rejects `8.0.4xx`/`latest` as values we have no version to bump them to. Co-authored-by: Claude Opus 5 <jamie.tanna+claude-code@mend.io>
18 lines
775 B
TypeScript
18 lines
775 B
TypeScript
import { DotnetVersionDatasource } from '../../../datasource/dotnet-version/index.ts';
|
|
import * as npmVersioning from '../../../versioning/npm/index.ts';
|
|
import type { KnownActionConfig } from '../types.ts';
|
|
import { valSchema } from './utils.ts';
|
|
|
|
export const dotnetVersionActions: Record<string, KnownActionConfig> = {
|
|
// https://github.com/actions/setup-dotnet
|
|
'actions/setup-dotnet': {
|
|
datasource: DotnetVersionDatasource.id,
|
|
packageName: 'dotnet-sdk',
|
|
// `dotnet-version` may be a channel (`8.0`), an x-range (`8.0.x`, `8.x`)
|
|
// or a major (`8`) rather than a pinned version, so it needs a versioning
|
|
// which understands ranges
|
|
versioning: npmVersioning.id,
|
|
withSchema: valSchema('dotnet-version', (val) => val.includes('\n')),
|
|
},
|
|
};
|