Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
"esbenp.prettier-vscode",
"ms-azuretools.vscode-containers",
"Tim-Koehler.helm-intellisense"
]
],
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh"
}
}
}
}
17 changes: 17 additions & 0 deletions .github/workflows/__greetings.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 15 additions & 8 deletions actions/helm/release-chart/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)`
);
}
}

Expand Down
Loading