[kube-prometheus-stack] set --force-conflicts on CRD job
#162
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: Renovate Bump Chart Version | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'charts/**/*' | |
| jobs: | |
| renovate-bump-chart-version: | |
| name: Renovate Bump Chart Version | |
| runs-on: ubuntu-latest | |
| if: github.actor == 'renovate[bot]' | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 | |
| with: | |
| python-version: '3.11' | |
| - name: Set up chart-testing | |
| uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0 | |
| - name: Detect changed charts | |
| id: list-changed | |
| run: | | |
| changed="$(ct list-changed --config .github/linters/ct.yaml)" | |
| if [[ -n "$changed" ]]; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| echo "changed_list=${changed//$'\n'/ }" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Bump chart version | |
| if: steps.list-changed.outputs.changed == 'true' | |
| env: | |
| CHART: ${{ steps.list-changed.outputs.changed_list }} | |
| run: | | |
| if [[ $CHANGED_LIST == *" "* ]]; then | |
| echo "Multiple charts changed, skipping bumping chart version" | |
| exit 0 | |
| fi | |
| CHART_VERSION=$(grep -e "^version:" "$CHART/Chart.yaml" | cut -d ":" -f 2 | tr -d '[:space:]' | tr -d '"') | |
| CHART_MAJOR_VERSION=$(printf '%s' "$CHART_VERSION" | cut -d "." -f 1) | |
| CHART_MINOR_VERSION=$(printf '%s' "$CHART_VERSION" | cut -d "." -f 2) | |
| CHART_MINOR_VERSION=$((CHART_MINOR_VERSION+1)) | |
| CHART_NEW_VERSION="${CHART_MAJOR_VERSION}.${CHART_MINOR_VERSION}.0" | |
| sed -i "s/^version:.*/version: \"${CHART_NEW_VERSION}\"/" "$CHART/Chart.yaml" | |
| - name: Commit changes | |
| if: steps.list-changed.outputs.changed == 'true' | |
| env: | |
| CHART: ${{ steps.list-changed.outputs.changed_list }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_HEAD_REF: ${{ github.head_ref }} | |
| run: | | |
| curl https://api.github.com/graphql -f \ | |
| -sSf -H "Authorization: Bearer $GITHUB_TOKEN" \ | |
| --data @- <<GRAPHQL | jq | |
| { | |
| "query": "mutation (\$input: CreateCommitOnBranchInput!) { | |
| createCommitOnBranch(input: \$input) { | |
| commit { | |
| url | |
| } | |
| } | |
| }", | |
| "variables": { | |
| "input": { | |
| "branch": { | |
| "repositoryNameWithOwner": "${{ github.repository }}", | |
| "branchName": "$GITHUB_HEAD_REF" | |
| }, | |
| "message": { "headline": "Update Chart.yaml" }, | |
| "fileChanges": { | |
| "additions": [ | |
| { | |
| "path": "$CHART/Chart.yaml", | |
| "contents": "$(base64 -w 0 <"$CHART/Chart.yaml")" | |
| } | |
| ] | |
| }, | |
| "expectedHeadOid": "${{ github.sha }}" | |
| } | |
| } | |
| } | |
| GRAPHQL |