diff --git a/lib/data/replacements.json b/lib/data/replacements.json index c5c5c412502..f30e9b02634 100644 --- a/lib/data/replacements.json +++ b/lib/data/replacements.json @@ -6,7 +6,6 @@ "replacements:actions-attest-build-provenance-to-actions-attest", "replacements:airbnb-prop-types-to-prop-types-tools", "replacements:apollo-server-to-scoped", - "replacements:astral-v8-full-semver", "replacements:babel-eslint-to-eslint-parser", "replacements:base-ui-components-to-base-ui", "replacements:containerbase", @@ -150,17 +149,6 @@ } ] }, - "astral-v8-full-semver": { - "description": "`astral-sh/setup-astral` now requires full SemVer tags as of v8", - "packageRules": [ - { - "matchPackageNames": ["astral-sh/setup-uv"], - "matchDatasources": ["github-tags"], - "replacementName": "astral-sh/setup-uv", - "replacementVersion": "v8.0.0" - } - ] - }, "babel-eslint-to-eslint-parser": { "description": "`babel-eslint` was renamed under the `@babel` scope.", "packageRules": [ diff --git a/lib/modules/manager/github-actions/__snapshots__/extract.spec.ts.snap b/lib/modules/manager/github-actions/__snapshots__/extract.spec.ts.snap index 2f1ab365b53..84209917216 100644 --- a/lib/modules/manager/github-actions/__snapshots__/extract.spec.ts.snap +++ b/lib/modules/manager/github-actions/__snapshots__/extract.spec.ts.snap @@ -21,7 +21,7 @@ exports[`modules/manager/github-actions/extract > extractPackageFile() > extract "depName": "docker/setup-qemu-action", "depType": "action", "replaceString": "docker/setup-qemu-action@c308fdd69d26ed66f4506ebd74b180abe5362145 # renovate: tag=v1.1.0", - "versioning": "semver-partial", + "versioning": "docker", }, { "autoReplaceStringTemplate": "{{depName}}@{{#if newDigest}}{{newDigest}}{{#if newValue}} # {{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}", @@ -31,7 +31,7 @@ exports[`modules/manager/github-actions/extract > extractPackageFile() > extract "depName": "actions/checkout", "depType": "action", "replaceString": "actions/checkout@1.0.0", - "versioning": "semver-partial", + "versioning": "docker", }, { "autoReplaceStringTemplate": "{{depName}}@{{#if newDigest}}{{newDigest}}{{#if newValue}} # {{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}", @@ -44,7 +44,7 @@ exports[`modules/manager/github-actions/extract > extractPackageFile() > extract "enabled": false, "replaceString": "docker/setup-qemu-action@c308fdd69d26ed66f4506ebd74b180abe5362145", "skipReason": "unversioned-reference", - "versioning": "semver-partial", + "versioning": "docker", }, { "autoReplaceStringTemplate": "{{depName}}@{{#if newDigest}}{{newDigest}}{{#if newValue}} # {{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}", @@ -54,7 +54,7 @@ exports[`modules/manager/github-actions/extract > extractPackageFile() > extract "depName": "docker/build-push-action", "depType": "action", "replaceString": "docker/build-push-action@v2", - "versioning": "semver-partial", + "versioning": "docker", }, { "autoReplaceStringTemplate": "{{depName}}@{{#if newDigest}}{{newDigest}}{{#if newValue}} # {{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}", @@ -65,7 +65,7 @@ exports[`modules/manager/github-actions/extract > extractPackageFile() > extract "depName": "actions/checkout", "depType": "action", "replaceString": "actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # tag=v2.4.0", - "versioning": "semver-partial", + "versioning": "docker", }, { "autoReplaceStringTemplate": "{{depName}}@{{#if newDigest}}{{newDigest}}{{#if newValue}} # {{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}", @@ -76,7 +76,7 @@ exports[`modules/manager/github-actions/extract > extractPackageFile() > extract "depName": "actions-rs/toolchain", "depType": "action", "replaceString": "actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7", - "versioning": "semver-partial", + "versioning": "docker", }, { "autoReplaceStringTemplate": "{{depName}}@{{#if newDigest}}{{newDigest}}{{#if newValue}} # {{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}", @@ -86,7 +86,7 @@ exports[`modules/manager/github-actions/extract > extractPackageFile() > extract "depName": "actions-rs/cargo", "depType": "action", "replaceString": "actions-rs/cargo@v1.0.3", - "versioning": "semver-partial", + "versioning": "docker", }, { "autoReplaceStringTemplate": "{{depName}}-{{newValue}}", diff --git a/lib/modules/manager/github-actions/extract.spec.ts b/lib/modules/manager/github-actions/extract.spec.ts index ede2fc96f14..7d6165c3596 100644 --- a/lib/modules/manager/github-actions/extract.spec.ts +++ b/lib/modules/manager/github-actions/extract.spec.ts @@ -163,7 +163,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'pascalgn/automerge-action', depType: 'action', replaceString: '"pascalgn/automerge-action@v0.13.1"', - versioning: 'semver-partial', + versioning: 'docker', }, { currentValue: 'v2.3.5', @@ -172,7 +172,7 @@ describe('modules/manager/github-actions/extract', () => { depType: 'action', replaceString: 'actions/checkout@1e204e9a9253d643386038d443f96446fa156a97 # renovate: tag=v2.3.5', - versioning: 'semver-partial', + versioning: 'docker', }, { currentValue: 'v1', @@ -180,7 +180,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/checkout', depType: 'action', replaceString: 'actions/checkout@v1', - versioning: 'semver-partial', + versioning: 'docker', }, { currentValue: 'v1.1.2', @@ -188,7 +188,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/checkout', depType: 'action', replaceString: '"actions/checkout@v1.1.2"', - versioning: 'semver-partial', + versioning: 'docker', }, { currentValue: '1.37.0-glibc', @@ -236,7 +236,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/setup-node', commitMessageTopic: '{{{depName}}} action', datasource: 'github-tags', - versioning: 'semver-partial', + versioning: 'docker', depType: 'action', replaceString: 'actions/setup-node@56337c425554a6be30cdef71bf441f15be286854 # tag=v3.1.1', @@ -249,7 +249,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/setup-node', commitMessageTopic: '{{{depName}}} action', datasource: 'github-tags', - versioning: 'semver-partial', + versioning: 'docker', depType: 'action', replaceString: "'actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561' # tag=v3.1.1", @@ -262,7 +262,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/setup-node', commitMessageTopic: '{{{depName}}} action', datasource: 'github-tags', - versioning: 'semver-partial', + versioning: 'docker', depType: 'action', replaceString: '"actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561" # tag=v2.5.1', @@ -275,7 +275,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/checkout', commitMessageTopic: '{{{depName}}} action', datasource: 'github-tags', - versioning: 'semver-partial', + versioning: 'docker', depType: 'action', replaceString: '"actions/checkout@v2"', autoReplaceStringTemplate: @@ -286,7 +286,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/setup-java', commitMessageTopic: '{{{depName}}} action', datasource: 'github-tags', - versioning: 'semver-partial', + versioning: 'docker', depType: 'action', replaceString: '"actions/setup-java@v2"', autoReplaceStringTemplate: @@ -575,7 +575,7 @@ describe('modules/manager/github-actions/extract', () => { expect(res?.deps[0]).toEqual({ depName: 'actions/checkout', commitMessageTopic: '{{{depName}}} action', - versioning: 'semver-partial', + versioning: 'docker', depType: 'action', replaceString: 'actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v4', @@ -600,7 +600,7 @@ describe('modules/manager/github-actions/extract', () => { expect(res?.deps[0]).toEqual({ depName: 'actions/checkout', commitMessageTopic: '{{{depName}}} action', - versioning: 'semver-partial', + versioning: 'docker', depType: 'action', replaceString: 'actions/checkout@c85c95e # v4', autoReplaceStringTemplate: @@ -776,7 +776,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/setup-node', depType: 'action', replaceString: 'actions/setup-node@v3', - versioning: 'semver-partial', + versioning: 'docker', }, { autoReplaceStringTemplate: @@ -787,7 +787,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/setup-node', depType: 'action', replaceString: 'actions/setup-node@v3', - versioning: 'semver-partial', + versioning: 'docker', }, { autoReplaceStringTemplate: @@ -798,7 +798,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/setup-go', depType: 'action', replaceString: 'actions/setup-go@v5', - versioning: 'semver-partial', + versioning: 'docker', }, { autoReplaceStringTemplate: @@ -809,7 +809,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/setup-python', depType: 'action', replaceString: 'actions/setup-python@v3', - versioning: 'semver-partial', + versioning: 'docker', }, { autoReplaceStringTemplate: @@ -820,7 +820,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/setup-node', depType: 'action', replaceString: 'actions/setup-node@v3', - versioning: 'semver-partial', + versioning: 'docker', }, { depName: 'node', @@ -926,7 +926,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/setup-node', depType: 'action', replaceString: 'actions/setup-node@v3', - versioning: 'semver-partial', + versioning: 'docker', }, { autoReplaceStringTemplate: @@ -937,7 +937,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/setup-node', depType: 'action', replaceString: 'actions/setup-node@v3', - versioning: 'semver-partial', + versioning: 'docker', }, { autoReplaceStringTemplate: @@ -948,7 +948,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/setup-go', depType: 'action', replaceString: 'actions/setup-go@v5', - versioning: 'semver-partial', + versioning: 'docker', }, { autoReplaceStringTemplate: @@ -959,7 +959,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/setup-python', depType: 'action', replaceString: 'actions/setup-python@v3', - versioning: 'semver-partial', + versioning: 'docker', }, { autoReplaceStringTemplate: @@ -970,7 +970,7 @@ describe('modules/manager/github-actions/extract', () => { depName: 'actions/setup-node', depType: 'action', replaceString: 'actions/setup-node@v3', - versioning: 'semver-partial', + versioning: 'docker', }, { depName: 'node', @@ -1469,45 +1469,4 @@ describe('modules/manager/github-actions/extract', () => { expected, ); }); - - it.each([ - { - step: { - uses: 'astral-sh/setup-uv@v7', - }, - expected: { - currentValue: 'v7', - datasource: 'github-tags', - depName: 'astral-sh/setup-uv', - depType: 'action', - }, - }, - { - step: { - uses: 'astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57', - }, - expected: { - currentDigest: 'cec208311dfd045dd5311c1add060b2062131d57', - datasource: 'github-tags', - depName: 'astral-sh/setup-uv', - depType: 'action', - }, - }, - ])( - 'overrides versioning for actions with Immutable tags: $step.uses', - ({ step, expected }) => { - const yamlContent = yaml.dump({ jobs: { build: { steps: [step] } } }); - - const res = extractPackageFile(yamlContent, 'workflow.yml'); - expect(res?.deps.filter((pkg) => pkg.depType === 'action')).toMatchObject( - [ - { - versioning: - 'regex:^v?(?\\d+)(\\.(?\\d+)\\.(?\\d+))?$', - ...expected, - }, - ], - ); - }, - ); }); diff --git a/lib/modules/manager/github-actions/extract.ts b/lib/modules/manager/github-actions/extract.ts index 2e0ca72c7ed..e065a6e02c9 100644 --- a/lib/modules/manager/github-actions/extract.ts +++ b/lib/modules/manager/github-actions/extract.ts @@ -13,7 +13,6 @@ import * as dockerVersioning from '../../versioning/docker/index.ts'; import * as exactVersioning from '../../versioning/exact/index.ts'; import * as nodeVersioning from '../../versioning/node/index.ts'; import * as npmVersioning from '../../versioning/npm/index.ts'; -import * as semverPartialVersioning from '../../versioning/semver-partial/index.ts'; import { getDep } from '../dockerfile/extract.ts'; import type { ExtractConfig, @@ -21,15 +20,11 @@ import type { PackageFileContent, } from '../types.ts'; import { CommunityActions } from './community.ts'; -import { ActionsUsingGitHubImmutableTags } from './immutable-actions.ts'; import type { DockerReference, RepositoryReference } from './parse.ts'; import { isSha, isShortSha, parseUsesLine, versionLikeRe } from './parse.ts'; import type { Steps } from './schema.ts'; import { Workflow } from './schema.ts'; -const semverWithOptionalMinorAndPatchversioning = - 'regex:^v?(?\\d+)(\\.(?\\d+)\\.(?\\d+))?$'; - // detects if we run against a Github Enterprise Server and adds the URL to the beginning of the registryURLs for looking up Actions // This reflects the behavior of how GitHub looks up Actions // First on the Enterprise Server, then on GitHub.com @@ -91,7 +86,7 @@ function extractRepositoryAction( const dep: PackageDependency = { depName, commitMessageTopic: '{{{depName}}} action', - versioning: semverPartialVersioning.id, + versioning: dockerVersioning.id, depType: 'action', replaceString: valueString, autoReplaceStringTemplate: `${quote}{{depName}}${pathSuffix}@{{#if newDigest}}{{newDigest}}${quote}{{#if newValue}}${commentWs}# {{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}${quote}{{/unless}}`, @@ -371,13 +366,5 @@ export function extractPackageFile( return null; } - for (const dep of deps) { - if ( - ActionsUsingGitHubImmutableTags.includes(dep.packageName ?? dep.depName!) - ) { - dep.versioning = semverWithOptionalMinorAndPatchversioning; - } - } - return { deps }; } diff --git a/lib/modules/manager/github-actions/immutable-actions.ts b/lib/modules/manager/github-actions/immutable-actions.ts deleted file mode 100644 index 01c0849d7aa..00000000000 --- a/lib/modules/manager/github-actions/immutable-actions.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Community actions which have migrated to Immutable Tags, which requires using strict SemVer - */ -export const ActionsUsingGitHubImmutableTags = [ - /** https://github.com/astral-sh/setup-uv/issues/830 */ - 'astral-sh/setup-uv', -];