Skip to content

Commit 901d0b5

Browse files
committed
ci: update helm-chart-update workflow
Create automatic-update label if it does not exist. Update Workflow name and Pull Request texts to include appVersion. Change branch name prefix to "auto-update/".
1 parent 0d535e6 commit 901d0b5

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

.github/workflows/helm-chart-update.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env:
1818

1919
jobs:
2020
update-helm-chart:
21-
name: Update Helm Chart CRDs
21+
name: Update Helm Chart CRDs and appVersion
2222
runs-on: ubuntu-latest
2323
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
2424
steps:
@@ -87,9 +87,9 @@ jobs:
8787
id: branch
8888
run: |
8989
if [[ "${{ steps.source.outputs.branch }}" == "main" ]]; then
90-
echo "name=crd-update/v${{ steps.version.outputs.version }}" >> "$GITHUB_OUTPUT"
90+
echo "name=auto-update/v${{ steps.version.outputs.version }}" >> "$GITHUB_OUTPUT"
9191
else
92-
echo "name=crd-update/${{ steps.source.outputs.branch }}" >> "$GITHUB_OUTPUT"
92+
echo "name=auto-update/${{ steps.source.outputs.branch }}" >> "$GITHUB_OUTPUT"
9393
fi
9494
9595
- name: Checkout or create target branch
@@ -115,7 +115,7 @@ jobs:
115115
git config user.email "github-actions[bot]@users.noreply.github.com"
116116
git add -A
117117
git diff --cached --quiet && echo "No changes to commit" && exit 0
118-
git commit -m "feat: update CRDs to version ${{ steps.version.outputs.version }}"
118+
git commit -m "feat: update CRDs and appVersion to version ${{ steps.version.outputs.version }}"
119119
git push origin "${{ steps.branch.outputs.name }}"
120120
121121
- name: Create Pull Request for main branch
@@ -124,18 +124,20 @@ jobs:
124124
GH_TOKEN: ${{ steps.app-token.outputs.token }}
125125
run: |
126126
cd ${{ env.CHART_DIR }}
127+
# Ensure the label exists
128+
gh label create "automatic-update" --description "Automated updates" --color "0E8A16" --repo "${{ env.HELM_REPO }}" 2>/dev/null || true
127129
EXISTING_PR=$(gh pr list --head "${{ steps.branch.outputs.name }}" --json number --jq '.[0].number' 2>/dev/null || true)
128130
if [[ -n "$EXISTING_PR" ]]; then
129131
echo "PR #${EXISTING_PR} already exists, updating..."
130132
gh pr edit "$EXISTING_PR" \
131-
--title "feat: update CRDs to v${{ steps.version.outputs.version }}" \
132-
--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 }})"
133+
--title "feat: update CRDs and appVersion to v${{ steps.version.outputs.version }}" \
134+
--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 }})"
133135
else
134136
gh pr create \
135137
--repo "${{ env.HELM_REPO }}" \
136138
--head "${{ steps.branch.outputs.name }}" \
137139
--base main \
138-
--title "feat: update CRDs to v${{ steps.version.outputs.version }}" \
139-
--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 }})" \
140+
--title "feat: update CRDs and appVersion to v${{ steps.version.outputs.version }}" \
141+
--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 }})" \
140142
--label "automatic-update"
141143
fi

0 commit comments

Comments
 (0)