File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
actions/helm/release-chart Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,12 @@ inputs:
5454 tag :
5555 description : " The release tag to set to chart"
5656 required : true
57+ update-tag-paths :
58+ description : |
59+ List of yaml paths to update with the tag.
60+ Comma separated list of paths.
61+ required : false
62+ default : " .version,.appVersion"
5763
5864outputs :
5965 image :
8490 throw new Error(`"tag" input is missing`);
8591 }
8692
93+ const updateTagPaths = `${{ inputs.update-tag-paths }}`.trim().split(',').map(p => p.trim()).filter(p => p);
94+
8795 // Chart.yml files
8896 const globber = await glob.create(`${basePath}/**/Chart.yaml`, {followSymbolicLinks: false})
8997 for await (const chartFile of globber.globGenerator()) {
@@ -98,12 +106,15 @@ runs:
98106 yqUpdates[filePath].push(`.name = "${{ github.event.repository.name }}"`);
99107
100108 // Update dependencies version where repository starts with file://
101- yqUpdates[filePath].push(`(.dependencies[] | select(.repository == "file://*")).version = "${tag}"`);
109+ if(updateTagPaths.includes('.version')) {
110+ yqUpdates[filePath].push(`(.dependencies[] | select(.repository == "file://*")).version = "${tag}"`);
111+ }
102112 }
103113
104- // Update version fields
105- yqUpdates[filePath].push(`.version = "${tag}"`);
106- yqUpdates[filePath].push(`.appVersion = "${tag}"`);
114+ // Update tag fields
115+ for (const path of updateTagPaths) {
116+ yqUpdates[filePath].push(`${path} = "${tag}"`);
117+ }
107118 }
108119
109120 // values.yml files
You can’t perform that action at this time.
0 commit comments