Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
3a4e7428
Unverified
Commit
3a4e7428
authored
3 years ago
by
Michael Kriese
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(github-action): do not remove paths (#10853)
parent
73cd3d51
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/manager/github-actions/__snapshots__/extract.spec.ts.snap
+3
-3
3 additions, 3 deletions
...manager/github-actions/__snapshots__/extract.spec.ts.snap
lib/manager/github-actions/extract.ts
+9
-4
9 additions, 4 deletions
lib/manager/github-actions/extract.ts
with
12 additions
and
7 deletions
lib/manager/github-actions/__snapshots__/extract.spec.ts.snap
+
3
−
3
View file @
3a4e7428
...
...
@@ -3,7 +3,7 @@
exports[`manager/github-actions/extract extractPackageFile() extracts multiple action tag lines from yaml configuration file 1`] = `
Array [
Object {
"autoReplaceStringTemplate": "{{depName}}@{{#if newDigest}}{{newDigest}}{{#if newValue}} # renovate: tag={{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}",
"autoReplaceStringTemplate": "{{depName}}
/shellcheck
@{{#if newDigest}}{{newDigest}}{{#if newValue}} # renovate: tag={{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}",
"commitMessageTopic": "{{{depName}}} action",
"currentValue": "master",
"datasource": "github-tags",
...
...
@@ -61,7 +61,7 @@ Array [
exports[`manager/github-actions/extract extractPackageFile() extracts multiple docker image lines from yaml configuration file 1`] = `
Array [
Object {
"autoReplaceStringTemplate": "{{depName}}@{{#if newDigest}}{{newDigest}}{{#if newValue}} # renovate: tag={{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}",
"autoReplaceStringTemplate": "{{depName}}
/shellcheck
@{{#if newDigest}}{{newDigest}}{{#if newValue}} # renovate: tag={{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}",
"commitMessageTopic": "{{{depName}}} action",
"currentValue": "master",
"datasource": "github-tags",
...
...
@@ -82,7 +82,7 @@ Array [
"versioning": "docker",
},
Object {
"autoReplaceStringTemplate": "{{depName}}@{{#if newDigest}}{{newDigest}}{{#if newValue}} # renovate: tag={{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}",
"autoReplaceStringTemplate": "{{depName}}
/cli
@{{#if newDigest}}{{newDigest}}{{#if newValue}} # renovate: tag={{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}",
"commitMessageTopic": "{{{depName}}} action",
"currentValue": "master",
"datasource": "github-tags",
...
...
This diff is collapsed.
Click to expand it.
lib/manager/github-actions/extract.ts
+
9
−
4
View file @
3a4e7428
...
...
@@ -7,7 +7,7 @@ import type { PackageDependency, PackageFile } from '../types';
const
dockerRe
=
/^
\s
+uses: docker:
\/\/([^
"
]
+
)\s
*$/
;
const
actionRe
=
/^
\s
+-
?\s
+
?
uses:
(?<
replaceString>
(?<
depName>
[\w
-
]
+
\/[\w
-
]
+
)(?<
path>.*
)?
@
(?<
currentValue>.+
?)(?:
# renovate: tag=
(?<
tag>.+
?))?)\s
*
?
$/
;
/^
\s
+-
?\s
+
?
uses:
(?<
replaceString>
(?<
depName>
[\w
-
]
+
\/[\w
-
]
+
)(?<
path>
\/
.*
)?
@
(?<
currentValue>.+
?)(?:
# renovate: tag=
(?<
tag>.+
?))?)\s
*
?
$/
;
// SHA1 or SHA256, see https://github.blog/2020-10-19-git-2-29-released/
const
shaRe
=
/^
[
a-z0-9
]{40}
|
[
a-z0-9
]{64}
$/
;
...
...
@@ -32,7 +32,13 @@ export function extractPackageFile(content: string): PackageFile | null {
const
tagMatch
=
actionRe
.
exec
(
line
);
if
(
tagMatch
?.
groups
)
{
const
{
depName
,
currentValue
,
tag
,
replaceString
}
=
tagMatch
.
groups
;
const
{
depName
,
currentValue
,
path
=
''
,
tag
,
replaceString
,
}
=
tagMatch
.
groups
;
const
dep
:
PackageDependency
=
{
depName
,
commitMessageTopic
:
'
{{{depName}}} action
'
,
...
...
@@ -40,8 +46,7 @@ export function extractPackageFile(content: string): PackageFile | null {
versioning
:
dockerVersioning
.
id
,
depType
:
'
action
'
,
replaceString
,
autoReplaceStringTemplate
:
'
{{depName}}@{{#if newDigest}}{{newDigest}}{{#if newValue}} # renovate: tag={{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}
'
,
autoReplaceStringTemplate
:
`{{depName}}
${
path
}
@{{#if newDigest}}{{newDigest}}{{#if newValue}} # renovate: tag={{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}`
,
};
if
(
shaRe
.
test
(
currentValue
))
{
dep
.
currentValue
=
tag
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment