fix(orchestrator): use versioned name for the DB creation Job to avoid immutable upgrade errors (1.10.1) #1638
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: Bump | |
| on: | |
| issue_comment: | |
| types: [created] | |
| jobs: | |
| chart-version: | |
| name: Chart Version | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - name: Check for command | |
| id: command | |
| continue-on-error: true | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| with: | |
| script: | | |
| const commentBody = context.payload.comment.body; | |
| const commandPrefix = "/bump "; | |
| let commandName = ""; | |
| let chartName = ""; | |
| let bumpLevel = ""; | |
| if (commentBody.startsWith(commandPrefix)) { | |
| commandName = "bump"; | |
| const args = commentBody.slice(commandPrefix.length).trim().split(" "); | |
| if (args.length > 0 && args[0]) { | |
| chartName = args[0]; | |
| bumpLevel = args[1] || "patch"; | |
| console.log(`Chart Name: ${chartName}, Bump Level: ${bumpLevel}`); | |
| console.log(`Args array: ${JSON.stringify(args)}`); | |
| const fs = require('fs'); | |
| fs.appendFileSync(process.env.GITHUB_OUTPUT, `chart-name=${chartName}\n`); | |
| fs.appendFileSync(process.env.GITHUB_OUTPUT, `bump-level=${bumpLevel}\n`); | |
| fs.appendFileSync(process.env.GITHUB_OUTPUT, `command-name=${commandName}\n`); | |
| } else { | |
| commandName = ""; | |
| core.warning("No chart name provided. Format: /bump <chart-name> [level]"); | |
| } | |
| } | |
| - name: Add eyes reaction | |
| if: steps.command.outputs.command-name == 'bump' | |
| uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| repository: ${{ github.repository }} | |
| comment-id: ${{ github.event.comment.id }} | |
| reactions: eyes | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 | |
| if: steps.command.outputs.command-name == 'bump' | |
| with: | |
| python-version: 3.14 | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 | |
| if: steps.command.outputs.command-name == 'bump' | |
| with: | |
| go-version: ^1 | |
| - name: Setup helm-docs | |
| if: steps.command.outputs.command-name == 'bump' | |
| run: go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest | |
| - name: Generate token | |
| if: steps.command.outputs.command-name == 'bump' | |
| id: generate_token | |
| uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2 | |
| with: | |
| app_id: ${{ vars.RHDH_GITHUB_APP_ID }} | |
| private_key: ${{ secrets.RHDH_GITHUB_APP_PRIVATE_KEY }} | |
| - name: Checkout Repository | |
| if: steps.command.outputs.command-name == 'bump' | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| with: | |
| token: ${{ steps.generate_token.outputs.token }} | |
| - name: Checkout Pull Request | |
| if: steps.command.outputs.command-name == 'bump' | |
| run: gh pr checkout ${{ github.event.issue.number }} | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} | |
| - name: Get version | |
| if: steps.command.outputs.command-name == 'bump' | |
| id: get_version | |
| uses: mikefarah/yq@1b9b4ac5187171d2e5e3129be0cfa827c7f9d53d # v4.53.3 | |
| with: | |
| cmd: yq ".version" charts/${{ steps.command.outputs.chart-name }}/Chart.yaml | |
| - uses: actions-ecosystem/action-bump-semver@34e334551143a5301f38c830e44a22273c6ff5c5 # v1 | |
| if: steps.command.outputs.command-name == 'bump' | |
| id: semver | |
| with: | |
| current_version: ${{ steps.get_version.outputs.result }} | |
| level: ${{ steps.command.outputs.bump-level }} | |
| - name: Bump the version | |
| if: steps.command.outputs.command-name == 'bump' | |
| uses: mikefarah/yq@1b9b4ac5187171d2e5e3129be0cfa827c7f9d53d # v4.53.3 | |
| with: | |
| cmd: yq -i '.version = "${{ steps.semver.outputs.new_version }}"' charts/${{ steps.command.outputs.chart-name }}/Chart.yaml | |
| - name: Run pre-commit | |
| if: steps.command.outputs.command-name == 'bump' | |
| uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 | |
| continue-on-error: true | |
| - name: Setup Gitsign | |
| if: steps.command.outputs.command-name == 'bump' | |
| uses: chainguard-dev/actions/setup-gitsign@3b7bbeebc3a5d2bc37aa008350202651c32a26e1 # v1.6.22 | |
| - name: Commit pre-commit changes | |
| if: steps.command.outputs.command-name == 'bump' | |
| uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7 | |
| with: | |
| commit_message: Bump ${{ steps.command.outputs.chart-name }} version to ${{ steps.semver.outputs.new_version }} | |
| commit_options: "-s" | |
| commit_user_name: RHDH Bot | |
| commit_user_email: 146280956+rhdh-bot@users.noreply.github.com | |
| commit_author: RHDH Bot <146280956+rhdh-bot@users.noreply.github.com > |