Merge branch 'main' into CCIE-5573-migrate-per-stack-dashboards-to-ce… #623
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Chart Dependencies | |
| on: | |
| push: | |
| branches-ignore: | |
| - main | |
| - artifacts | |
| jobs: | |
| update_chart_locks: | |
| runs-on: ARM64 | |
| steps: | |
| - name: Generate token | |
| uses: actions/create-github-app-token@v1 | |
| id: generate_token | |
| with: | |
| app-id: ${{ secrets.GH_ACTIONS_HELPER_APP_ID }} | |
| private-key: ${{ secrets.GH_ACTIONS_HELPER_PK }} | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ steps.generate_token.outputs.token }} | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| initial-fetch-depth: '1' | |
| list-files: json | |
| filters: | | |
| changed: | |
| - added|modified: '**' | |
| - uses: actions/github-script@v7 | |
| id: changed_charts | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const path = require("path"); | |
| const changedFiles = ${{ steps.filter.outputs.changed_files }} | |
| const changedDirs = changedFiles.map(f => path.dirname(f)).filter(dir => fs.existsSync(path.join(dir, 'Chart.lock'))); | |
| const uniqueChangedDirs = [...new Set(changedDirs)]; | |
| console.log(`Found the following changed charts: ${JSON.stringify(uniqueChangedDirs, null, 2)}\n OG: ${JSON.stringify(changedFiles, null, 2)} `) | |
| core.setOutput('changed_chart_dirs', uniqueChangedDirs) | |
| core.setOutput('changed_chart_dirs_bash', uniqueChangedDirs.join(' ')); | |
| - uses: azure/setup-helm@v4 | |
| with: | |
| version: '3.15.2' | |
| - name: Update Chart.lock | |
| run: | | |
| for chart in ${{ steps.changed_charts.outputs.changed_chart_dirs_bash }} | |
| do | |
| echo "----------------------------------------" | |
| echo "Updating ${chart}/Chart.lock" | |
| helm dependency update ${chart} | |
| git diff ${chart}/Chart.lock | |
| done | |
| - name: Commit changes | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| add: -A | |
| message: 'ci - update chart dependencies' |