diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 52e9b560..9587b136 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -20,7 +20,10 @@ "esbenp.prettier-vscode", "ms-azuretools.vscode-containers", "Tim-Koehler.helm-intellisense" - ] + ], + "settings": { + "terminal.integrated.defaultProfile.linux": "zsh" + } } } } diff --git a/.github/workflows/__greetings.yml b/.github/workflows/__greetings.yml new file mode 100644 index 00000000..51345973 --- /dev/null +++ b/.github/workflows/__greetings.yml @@ -0,0 +1,17 @@ +name: Greetings + +on: + issues: + types: [opened] + pull_request_target: + branches: [main] + +permissions: {} + +jobs: + greetings: + uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@5ac504609f6ef35c5ac94bd8199063aa32104721 # 0.31.3 + permissions: + contents: read + issues: write + pull-requests: write diff --git a/actions/helm/release-chart/action.yml b/actions/helm/release-chart/action.yml index a7efe193..712f2730 100644 --- a/actions/helm/release-chart/action.yml +++ b/actions/helm/release-chart/action.yml @@ -80,39 +80,46 @@ runs: - id: chart-values-updates uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + env: + INPUT_PATH: ${{ inputs.path }} + INPUT_TAG: ${{ inputs.tag }} + INPUT_UPDATE_TAG_PATHS: ${{ inputs.update-tag-paths }} + REPOSITORY_NAME: ${{ github.event.repository.name }} with: script: | const path = require('node:path'); const yqUpdates = {}; - const basePath = `${{ inputs.path }}`; + const basePath = process.env.INPUT_PATH; if (!basePath) { throw new Error(`"path" input is missing`); } - const tag = `${{ inputs.tag }}`; + const tag = process.env.INPUT_TAG; if (!tag) { throw new Error(`"tag" input is missing`); } - const updateTagPaths = `${{ inputs.update-tag-paths }}`.trim().split(',').map(p => p.trim()).filter(p => p); + const updateTagPaths = process.env.INPUT_UPDATE_TAG_PATHS.trim().split(',').map(p => p.trim()).filter(p => p); // Chart.yml files const globber = await glob.create(`${basePath}/**/Chart.yaml`, {followSymbolicLinks: false}) for await (const chartFile of globber.globGenerator()) { - const filePath = path.relative(`${{ github.workspace }}`, chartFile); + const filePath = path.relative(process.env.GITHUB_WORKSPACE, chartFile); if (!yqUpdates[filePath]) { yqUpdates[filePath] = []; } - const isRootChart = filePath === `${basePath}/Chart.yaml`; + const isRootChart = filePath === path.join(basePath, "Chart.yaml"); if (isRootChart) { // Update name for root chart - yqUpdates[filePath].push(`.name = "${{ github.event.repository.name }}"`); + yqUpdates[filePath].push(`.name = "${process.env.REPOSITORY_NAME}"`); // Update dependencies version where repository starts with file:// - if(updateTagPaths.includes('.version')) { - yqUpdates[filePath].push(`(.dependencies[] | select(.repository == "file://*")).version = "${tag}"`); + if (updateTagPaths.includes('.version')) { + yqUpdates[filePath].push( + `(. as $doc | (select(has("dependencies")) | (.dependencies[] | select(.repository == "file://*")).version = "${tag}") // $doc)` + ); } }