Skip to content

feat(patterns): add chart-repo-watcher pattern#109

Merged
adamancini merged 3 commits intomainfrom
adamancini/chart-repo-watcher-pattern
Mar 25, 2026
Merged

feat(patterns): add chart-repo-watcher pattern#109
adamancini merged 3 commits intomainfrom
adamancini/chart-repo-watcher-pattern

Conversation

@adamancini
Copy link
Member

Summary

  • Adds a new 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 akkoma-chart-update workflow, generalized for reuse
  • Covers adaptations for Helm repositories, OCI registries, monorepos, and multi-channel release strategies

Test plan

  • Verify README renders correctly on GitHub
  • Confirm workflow YAML is valid and matches the described behavior
  • Cross-reference against the live akkoma-chart-update workflow for accuracy

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.
@adamancini adamancini marked this pull request as draft February 16, 2026 21:20
@adamancini adamancini added type::feature type::docs Improvements or additions to documentation labels Feb 16, 2026
@adamancini adamancini marked this pull request as ready for review March 2, 2026 16:37
Copilot AI review requested due to automatic review settings March 25, 2026 21:04
@adamancini adamancini merged commit 25d6005 into main Mar 25, 2026
3 checks passed
@adamancini adamancini deleted the adamancini/chart-repo-watcher-pattern branch March 25, 2026 21:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-updatebuild-and-releaseopen-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.

Comment on lines +129 to +133
- name: Update chartVersion in HelmChart manifest
run: |
version="${{ needs.check-update.outputs.new_version }}"
yq -i '.spec.chart.chartVersion = "'"${version}"'"' kots/my-chart.yaml

Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines +138 to +148
- 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}"
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
default: ''

concurrency:
group: chart-update
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
group: chart-update
group: chart-update-${{ vars.REPLICATED_APP || 'my-app' }}

Copilot uses AI. Check for mistakes.

## Automated
This PR was created by the chart-update workflow." \
--base main \
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
--base main \
--base "${{ github.event.repository.default_branch }}" \

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type::docs Improvements or additions to documentation type::feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants