feat(patterns): add chart-repo-watcher pattern#109
Conversation
Add a pattern showing how to build a GitHub Actions workflow that watches an upstream Helm chart repo for new releases and automatically creates PRs with version bumps. Based on the akkoma application's chart-update workflow.
There was a problem hiding this comment.
Pull request overview
Adds a new documentation pattern (“chart-repo-watcher”) describing a GitHub Actions workflow that detects upstream Helm chart releases, builds/validates updates, creates a Replicated release, and opens an update PR.
Changes:
- Added a new pattern README documenting a 3-job chart update workflow (
check-update→build-and-release→open-pr) - Documented key design decisions (concurrency, manual override, tag parsing, release-before-PR)
- Included adaptation notes for Helm repos, OCI registries, monorepos, and release channel strategies
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Update chartVersion in HelmChart manifest | ||
| run: | | ||
| version="${{ needs.check-update.outputs.new_version }}" | ||
| yq -i '.spec.chart.chartVersion = "'"${version}"'"' kots/my-chart.yaml | ||
|
|
There was a problem hiding this comment.
The build-and-release job updates chartVersion using yq, but this workflow snippet never installs yq in that job (only in open-pr). As written, the Update chartVersion... step will fail on a fresh runner; add a tool-setup step (e.g., reuse the repo’s ./.github/actions/setup-tools composite action or install yq in build-and-release).
| - name: Lint KOTS manifests | ||
| run: | | ||
| replicated release lint --yaml-dir kots/ | ||
|
|
||
| - name: Create Replicated release | ||
| run: | | ||
| version="${{ needs.check-update.outputs.new_version }}" | ||
| replicated release create \ | ||
| --yaml-dir kots/ \ | ||
| --promote Unstable \ | ||
| --version "${version}" |
There was a problem hiding this comment.
This workflow snippet invokes the replicated CLI (replicated release lint/create) but never installs it. GitHub-hosted runners don’t include the Replicated CLI by default, so the lint/create steps will fail unless you add an install step (again, ./.github/actions/setup-tools in this repo already handles this).
| default: '' | ||
|
|
||
| concurrency: | ||
| group: chart-update |
There was a problem hiding this comment.
concurrency.group is set to a generic value (chart-update). If a repo has multiple chart-watcher workflows, they’ll cancel each other. Consider including the app/chart identifier in the group name (e.g., derived from REPLICATED_APP/chart name) to avoid unrelated runs being canceled.
| group: chart-update | |
| group: chart-update-${{ vars.REPLICATED_APP || 'my-app' }} |
|
|
||
| ## Automated | ||
| This PR was created by the chart-update workflow." \ | ||
| --base main \ |
There was a problem hiding this comment.
gh pr create uses --base main hard-coded. In repos where the default branch isn’t main, this will fail. Using the repository default branch (or documenting that main is required) makes this pattern more reusable.
| --base main \ | |
| --base "${{ github.event.repository.default_branch }}" \ |
Summary
akkoma-chart-updateworkflow, generalized for reuseTest plan