Skip to content

Commit db64cc6

Browse files
authored
fix(manager/github-actions): revert recent changes (#42707)
* Revert "fix(manager/github-actions): override `versioning` for Actions with Immutable Tags (#42690)" This reverts commit 1b0785b. * Revert "feat(replacements): migrate users to astral/setup-uv v8 (#42683)" This reverts commit f5859c2. * Revert "feat(manager/github-actions): use `semver-partial` as default versioning (#42685)" This reverts commit da04b8e.
1 parent fe10c94 commit db64cc6

5 files changed

Lines changed: 29 additions & 102 deletions

File tree

lib/data/replacements.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"replacements:actions-attest-build-provenance-to-actions-attest",
77
"replacements:airbnb-prop-types-to-prop-types-tools",
88
"replacements:apollo-server-to-scoped",
9-
"replacements:astral-v8-full-semver",
109
"replacements:babel-eslint-to-eslint-parser",
1110
"replacements:base-ui-components-to-base-ui",
1211
"replacements:containerbase",
@@ -150,17 +149,6 @@
150149
}
151150
]
152151
},
153-
"astral-v8-full-semver": {
154-
"description": "`astral-sh/setup-astral` now requires full SemVer tags as of v8",
155-
"packageRules": [
156-
{
157-
"matchPackageNames": ["astral-sh/setup-uv"],
158-
"matchDatasources": ["github-tags"],
159-
"replacementName": "astral-sh/setup-uv",
160-
"replacementVersion": "v8.0.0"
161-
}
162-
]
163-
},
164152
"babel-eslint-to-eslint-parser": {
165153
"description": "`babel-eslint` was renamed under the `@babel` scope.",
166154
"packageRules": [

lib/modules/manager/github-actions/__snapshots__/extract.spec.ts.snap

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exports[`modules/manager/github-actions/extract > extractPackageFile() > extract
2121
"depName": "docker/setup-qemu-action",
2222
"depType": "action",
2323
"replaceString": "docker/setup-qemu-action@c308fdd69d26ed66f4506ebd74b180abe5362145 # renovate: tag=v1.1.0",
24-
"versioning": "semver-partial",
24+
"versioning": "docker",
2525
},
2626
{
2727
"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
3131
"depName": "actions/checkout",
3232
"depType": "action",
3333
"replaceString": "actions/checkout@1.0.0",
34-
"versioning": "semver-partial",
34+
"versioning": "docker",
3535
},
3636
{
3737
"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
4444
"enabled": false,
4545
"replaceString": "docker/setup-qemu-action@c308fdd69d26ed66f4506ebd74b180abe5362145",
4646
"skipReason": "unversioned-reference",
47-
"versioning": "semver-partial",
47+
"versioning": "docker",
4848
},
4949
{
5050
"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
5454
"depName": "docker/build-push-action",
5555
"depType": "action",
5656
"replaceString": "docker/build-push-action@v2",
57-
"versioning": "semver-partial",
57+
"versioning": "docker",
5858
},
5959
{
6060
"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
6565
"depName": "actions/checkout",
6666
"depType": "action",
6767
"replaceString": "actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # tag=v2.4.0",
68-
"versioning": "semver-partial",
68+
"versioning": "docker",
6969
},
7070
{
7171
"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
7676
"depName": "actions-rs/toolchain",
7777
"depType": "action",
7878
"replaceString": "actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7",
79-
"versioning": "semver-partial",
79+
"versioning": "docker",
8080
},
8181
{
8282
"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
8686
"depName": "actions-rs/cargo",
8787
"depType": "action",
8888
"replaceString": "actions-rs/cargo@v1.0.3",
89-
"versioning": "semver-partial",
89+
"versioning": "docker",
9090
},
9191
{
9292
"autoReplaceStringTemplate": "{{depName}}-{{newValue}}",

lib/modules/manager/github-actions/extract.spec.ts

Lines changed: 21 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ describe('modules/manager/github-actions/extract', () => {
163163
depName: 'pascalgn/automerge-action',
164164
depType: 'action',
165165
replaceString: '"pascalgn/automerge-action@v0.13.1"',
166-
versioning: 'semver-partial',
166+
versioning: 'docker',
167167
},
168168
{
169169
currentValue: 'v2.3.5',
@@ -172,23 +172,23 @@ describe('modules/manager/github-actions/extract', () => {
172172
depType: 'action',
173173
replaceString:
174174
'actions/checkout@1e204e9a9253d643386038d443f96446fa156a97 # renovate: tag=v2.3.5',
175-
versioning: 'semver-partial',
175+
versioning: 'docker',
176176
},
177177
{
178178
currentValue: 'v1',
179179
datasource: 'github-tags',
180180
depName: 'actions/checkout',
181181
depType: 'action',
182182
replaceString: 'actions/checkout@v1',
183-
versioning: 'semver-partial',
183+
versioning: 'docker',
184184
},
185185
{
186186
currentValue: 'v1.1.2',
187187
datasource: 'github-tags',
188188
depName: 'actions/checkout',
189189
depType: 'action',
190190
replaceString: '"actions/checkout@v1.1.2"',
191-
versioning: 'semver-partial',
191+
versioning: 'docker',
192192
},
193193
{
194194
currentValue: '1.37.0-glibc',
@@ -236,7 +236,7 @@ describe('modules/manager/github-actions/extract', () => {
236236
depName: 'actions/setup-node',
237237
commitMessageTopic: '{{{depName}}} action',
238238
datasource: 'github-tags',
239-
versioning: 'semver-partial',
239+
versioning: 'docker',
240240
depType: 'action',
241241
replaceString:
242242
'actions/setup-node@56337c425554a6be30cdef71bf441f15be286854 # tag=v3.1.1',
@@ -249,7 +249,7 @@ describe('modules/manager/github-actions/extract', () => {
249249
depName: 'actions/setup-node',
250250
commitMessageTopic: '{{{depName}}} action',
251251
datasource: 'github-tags',
252-
versioning: 'semver-partial',
252+
versioning: 'docker',
253253
depType: 'action',
254254
replaceString:
255255
"'actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561' # tag=v3.1.1",
@@ -262,7 +262,7 @@ describe('modules/manager/github-actions/extract', () => {
262262
depName: 'actions/setup-node',
263263
commitMessageTopic: '{{{depName}}} action',
264264
datasource: 'github-tags',
265-
versioning: 'semver-partial',
265+
versioning: 'docker',
266266
depType: 'action',
267267
replaceString:
268268
'"actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561" # tag=v2.5.1',
@@ -275,7 +275,7 @@ describe('modules/manager/github-actions/extract', () => {
275275
depName: 'actions/checkout',
276276
commitMessageTopic: '{{{depName}}} action',
277277
datasource: 'github-tags',
278-
versioning: 'semver-partial',
278+
versioning: 'docker',
279279
depType: 'action',
280280
replaceString: '"actions/checkout@v2"',
281281
autoReplaceStringTemplate:
@@ -286,7 +286,7 @@ describe('modules/manager/github-actions/extract', () => {
286286
depName: 'actions/setup-java',
287287
commitMessageTopic: '{{{depName}}} action',
288288
datasource: 'github-tags',
289-
versioning: 'semver-partial',
289+
versioning: 'docker',
290290
depType: 'action',
291291
replaceString: '"actions/setup-java@v2"',
292292
autoReplaceStringTemplate:
@@ -575,7 +575,7 @@ describe('modules/manager/github-actions/extract', () => {
575575
expect(res?.deps[0]).toEqual({
576576
depName: 'actions/checkout',
577577
commitMessageTopic: '{{{depName}}} action',
578-
versioning: 'semver-partial',
578+
versioning: 'docker',
579579
depType: 'action',
580580
replaceString:
581581
'actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v4',
@@ -600,7 +600,7 @@ describe('modules/manager/github-actions/extract', () => {
600600
expect(res?.deps[0]).toEqual({
601601
depName: 'actions/checkout',
602602
commitMessageTopic: '{{{depName}}} action',
603-
versioning: 'semver-partial',
603+
versioning: 'docker',
604604
depType: 'action',
605605
replaceString: 'actions/checkout@c85c95e # v4',
606606
autoReplaceStringTemplate:
@@ -776,7 +776,7 @@ describe('modules/manager/github-actions/extract', () => {
776776
depName: 'actions/setup-node',
777777
depType: 'action',
778778
replaceString: 'actions/setup-node@v3',
779-
versioning: 'semver-partial',
779+
versioning: 'docker',
780780
},
781781
{
782782
autoReplaceStringTemplate:
@@ -787,7 +787,7 @@ describe('modules/manager/github-actions/extract', () => {
787787
depName: 'actions/setup-node',
788788
depType: 'action',
789789
replaceString: 'actions/setup-node@v3',
790-
versioning: 'semver-partial',
790+
versioning: 'docker',
791791
},
792792
{
793793
autoReplaceStringTemplate:
@@ -798,7 +798,7 @@ describe('modules/manager/github-actions/extract', () => {
798798
depName: 'actions/setup-go',
799799
depType: 'action',
800800
replaceString: 'actions/setup-go@v5',
801-
versioning: 'semver-partial',
801+
versioning: 'docker',
802802
},
803803
{
804804
autoReplaceStringTemplate:
@@ -809,7 +809,7 @@ describe('modules/manager/github-actions/extract', () => {
809809
depName: 'actions/setup-python',
810810
depType: 'action',
811811
replaceString: 'actions/setup-python@v3',
812-
versioning: 'semver-partial',
812+
versioning: 'docker',
813813
},
814814
{
815815
autoReplaceStringTemplate:
@@ -820,7 +820,7 @@ describe('modules/manager/github-actions/extract', () => {
820820
depName: 'actions/setup-node',
821821
depType: 'action',
822822
replaceString: 'actions/setup-node@v3',
823-
versioning: 'semver-partial',
823+
versioning: 'docker',
824824
},
825825
{
826826
depName: 'node',
@@ -926,7 +926,7 @@ describe('modules/manager/github-actions/extract', () => {
926926
depName: 'actions/setup-node',
927927
depType: 'action',
928928
replaceString: 'actions/setup-node@v3',
929-
versioning: 'semver-partial',
929+
versioning: 'docker',
930930
},
931931
{
932932
autoReplaceStringTemplate:
@@ -937,7 +937,7 @@ describe('modules/manager/github-actions/extract', () => {
937937
depName: 'actions/setup-node',
938938
depType: 'action',
939939
replaceString: 'actions/setup-node@v3',
940-
versioning: 'semver-partial',
940+
versioning: 'docker',
941941
},
942942
{
943943
autoReplaceStringTemplate:
@@ -948,7 +948,7 @@ describe('modules/manager/github-actions/extract', () => {
948948
depName: 'actions/setup-go',
949949
depType: 'action',
950950
replaceString: 'actions/setup-go@v5',
951-
versioning: 'semver-partial',
951+
versioning: 'docker',
952952
},
953953
{
954954
autoReplaceStringTemplate:
@@ -959,7 +959,7 @@ describe('modules/manager/github-actions/extract', () => {
959959
depName: 'actions/setup-python',
960960
depType: 'action',
961961
replaceString: 'actions/setup-python@v3',
962-
versioning: 'semver-partial',
962+
versioning: 'docker',
963963
},
964964
{
965965
autoReplaceStringTemplate:
@@ -970,7 +970,7 @@ describe('modules/manager/github-actions/extract', () => {
970970
depName: 'actions/setup-node',
971971
depType: 'action',
972972
replaceString: 'actions/setup-node@v3',
973-
versioning: 'semver-partial',
973+
versioning: 'docker',
974974
},
975975
{
976976
depName: 'node',
@@ -1469,45 +1469,4 @@ describe('modules/manager/github-actions/extract', () => {
14691469
expected,
14701470
);
14711471
});
1472-
1473-
it.each([
1474-
{
1475-
step: {
1476-
uses: 'astral-sh/setup-uv@v7',
1477-
},
1478-
expected: {
1479-
currentValue: 'v7',
1480-
datasource: 'github-tags',
1481-
depName: 'astral-sh/setup-uv',
1482-
depType: 'action',
1483-
},
1484-
},
1485-
{
1486-
step: {
1487-
uses: 'astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57',
1488-
},
1489-
expected: {
1490-
currentDigest: 'cec208311dfd045dd5311c1add060b2062131d57',
1491-
datasource: 'github-tags',
1492-
depName: 'astral-sh/setup-uv',
1493-
depType: 'action',
1494-
},
1495-
},
1496-
])(
1497-
'overrides versioning for actions with Immutable tags: $step.uses',
1498-
({ step, expected }) => {
1499-
const yamlContent = yaml.dump({ jobs: { build: { steps: [step] } } });
1500-
1501-
const res = extractPackageFile(yamlContent, 'workflow.yml');
1502-
expect(res?.deps.filter((pkg) => pkg.depType === 'action')).toMatchObject(
1503-
[
1504-
{
1505-
versioning:
1506-
'regex:^v?(?<major>\\d+)(\\.(?<minor>\\d+)\\.(?<patch>\\d+))?$',
1507-
...expected,
1508-
},
1509-
],
1510-
);
1511-
},
1512-
);
15131472
});

lib/modules/manager/github-actions/extract.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,18 @@ import * as dockerVersioning from '../../versioning/docker/index.ts';
1313
import * as exactVersioning from '../../versioning/exact/index.ts';
1414
import * as nodeVersioning from '../../versioning/node/index.ts';
1515
import * as npmVersioning from '../../versioning/npm/index.ts';
16-
import * as semverPartialVersioning from '../../versioning/semver-partial/index.ts';
1716
import { getDep } from '../dockerfile/extract.ts';
1817
import type {
1918
ExtractConfig,
2019
PackageDependency,
2120
PackageFileContent,
2221
} from '../types.ts';
2322
import { CommunityActions } from './community.ts';
24-
import { ActionsUsingGitHubImmutableTags } from './immutable-actions.ts';
2523
import type { DockerReference, RepositoryReference } from './parse.ts';
2624
import { isSha, isShortSha, parseUsesLine, versionLikeRe } from './parse.ts';
2725
import type { Steps } from './schema.ts';
2826
import { Workflow } from './schema.ts';
2927

30-
const semverWithOptionalMinorAndPatchversioning =
31-
'regex:^v?(?<major>\\d+)(\\.(?<minor>\\d+)\\.(?<patch>\\d+))?$';
32-
3328
// detects if we run against a Github Enterprise Server and adds the URL to the beginning of the registryURLs for looking up Actions
3429
// This reflects the behavior of how GitHub looks up Actions
3530
// First on the Enterprise Server, then on GitHub.com
@@ -91,7 +86,7 @@ function extractRepositoryAction(
9186
const dep: PackageDependency = {
9287
depName,
9388
commitMessageTopic: '{{{depName}}} action',
94-
versioning: semverPartialVersioning.id,
89+
versioning: dockerVersioning.id,
9590
depType: 'action',
9691
replaceString: valueString,
9792
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(
371366
return null;
372367
}
373368

374-
for (const dep of deps) {
375-
if (
376-
ActionsUsingGitHubImmutableTags.includes(dep.packageName ?? dep.depName!)
377-
) {
378-
dep.versioning = semverWithOptionalMinorAndPatchversioning;
379-
}
380-
}
381-
382369
return { deps };
383370
}

lib/modules/manager/github-actions/immutable-actions.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)