Skip to content
Merged
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
18 changes: 10 additions & 8 deletions .github/workflows/helm-chart-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:

jobs:
update-helm-chart:
name: Update Helm Chart CRDs
name: Update Helm Chart CRDs and appVersion
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
steps:
Expand Down Expand Up @@ -87,9 +87,9 @@ jobs:
id: branch
run: |
if [[ "${{ steps.source.outputs.branch }}" == "main" ]]; then
echo "name=crd-update/v${{ steps.version.outputs.version }}" >> "$GITHUB_OUTPUT"
echo "name=auto-update/v${{ steps.version.outputs.version }}" >> "$GITHUB_OUTPUT"
else
echo "name=crd-update/${{ steps.source.outputs.branch }}" >> "$GITHUB_OUTPUT"
echo "name=auto-update/${{ steps.source.outputs.branch }}" >> "$GITHUB_OUTPUT"
fi

- name: Checkout or create target branch
Expand All @@ -115,7 +115,7 @@ jobs:
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git diff --cached --quiet && echo "No changes to commit" && exit 0
git commit -m "feat: update CRDs to version ${{ steps.version.outputs.version }}"
git commit -m "feat: update CRDs and appVersion to version ${{ steps.version.outputs.version }}"
git push origin "${{ steps.branch.outputs.name }}"

- name: Create Pull Request for main branch
Expand All @@ -124,18 +124,20 @@ jobs:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
cd ${{ env.CHART_DIR }}
# Ensure the label exists
gh label create "automatic-update" --description "Automated updates" --color "0E8A16" --repo "${{ env.HELM_REPO }}" 2>/dev/null || true
EXISTING_PR=$(gh pr list --head "${{ steps.branch.outputs.name }}" --json number --jq '.[0].number' 2>/dev/null || true)
if [[ -n "$EXISTING_PR" ]]; then
echo "PR #${EXISTING_PR} already exists, updating..."
gh pr edit "$EXISTING_PR" \
--title "feat: update CRDs to v${{ steps.version.outputs.version }}" \
--body "Automated CRD update from [git-hubby release v${{ steps.version.outputs.version }}](https://github.com/${{ github.repository }}/releases/tag/v${{ steps.version.outputs.version }})"
--title "feat: update CRDs and appVersion to v${{ steps.version.outputs.version }}" \
--body "Automated CRD and appVersion update from [git-hubby release v${{ steps.version.outputs.version }}](https://github.com/${{ github.repository }}/releases/tag/v${{ steps.version.outputs.version }})"
else
gh pr create \
--repo "${{ env.HELM_REPO }}" \
--head "${{ steps.branch.outputs.name }}" \
--base main \
--title "feat: update CRDs to v${{ steps.version.outputs.version }}" \
--body "Automated CRD update from [git-hubby release v${{ steps.version.outputs.version }}](https://github.com/${{ github.repository }}/releases/tag/v${{ steps.version.outputs.version }})" \
--title "feat: update CRDs and appVersion to v${{ steps.version.outputs.version }}" \
--body "Automated CRD and appVersion update from [git-hubby release v${{ steps.version.outputs.version }}](https://github.com/${{ github.repository }}/releases/tag/v${{ steps.version.outputs.version }})" \
--label "automatic-update"
fi
Loading