@@ -80,39 +80,44 @@ runs:
8080
8181 - id : chart-values-updates
8282 uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
83+ env :
84+ INPUT_PATH : ${{ inputs.path }}
85+ INPUT_TAG : ${{ inputs.tag }}
86+ INPUT_UPDATE_TAG_PATHS : ${{ inputs.update-tag-paths }}
87+ REPOSITORY_NAME : ${{ github.event.repository.name }}
8388 with :
8489 script : |
8590 const path = require('node:path');
8691
8792 const yqUpdates = {};
88- const basePath = `${{ inputs.path }}` ;
93+ const basePath = process.env.INPUT_PATH ;
8994 if (!basePath) {
9095 throw new Error(`"path" input is missing`);
9196 }
9297
93- const tag = `${{ inputs.tag }}` ;
98+ const tag = process.env.INPUT_TAG ;
9499 if (!tag) {
95100 throw new Error(`"tag" input is missing`);
96101 }
97102
98- const updateTagPaths = `${{ inputs.update-tag-paths }}` .trim().split(',').map(p => p.trim()).filter(p => p);
103+ const updateTagPaths = process.env.INPUT_UPDATE_TAG_PATHS .trim().split(',').map(p => p.trim()).filter(p => p);
99104
100105 // Chart.yml files
101106 const globber = await glob.create(`${basePath}/**/Chart.yaml`, {followSymbolicLinks: false})
102107 for await (const chartFile of globber.globGenerator()) {
103- const filePath = path.relative(`${{ github.workspace }}` , chartFile);
108+ const filePath = path.relative(process.env.GITHUB_WORKSPACE , chartFile);
104109 if (!yqUpdates[filePath]) {
105110 yqUpdates[filePath] = [];
106111 }
107112
108- const isRootChart = filePath === `${ basePath}/ Chart.yaml` ;
113+ const isRootChart = filePath === path.join( basePath, " Chart.yaml") ;
109114 if (isRootChart) {
110115 // Update name for root chart
111- yqUpdates[filePath].push(`.name = "${{ github.event.repository.name } }"`);
116+ yqUpdates[filePath].push(`.name = "${process.env.REPOSITORY_NAME }"`);
112117
113118 // Update dependencies version where repository starts with file://
114- if(updateTagPaths.includes('.version')) {
115- yqUpdates[filePath].push(`(.dependencies[] | select(.repository == "file://*")).version = "${tag}"`);
119+ if (updateTagPaths.includes('.version')) {
120+ yqUpdates[filePath].push(`(.dependencies[]? | select(.repository == "file://*")).version = "${tag}"`);
116121 }
117122 }
118123
0 commit comments