Skip to content
Merged
Show file tree
Hide file tree
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
48 changes: 44 additions & 4 deletions .github/workflows/sync-from-upstream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
outputs:
entries: ${{ steps.changelogger.outputs.entries }}
drift: ${{ steps.values_drift.outputs.drift }}
title: ${{ steps.detect.outputs.title }}
steps:
- name: Generate token
id: generate_token
Expand Down Expand Up @@ -150,19 +151,31 @@ jobs:
in_deps && /name:/ { print $NF }
' "${CHART_YAML}")

# Read a subchart's version, preferring appVersion and falling back to
# version when appVersion is not set. $2 skips any trailing "# VERSION" comment.
chart_version() {
awk '
/^appVersion:/ { appv = $2 }
/^version:/ { ver = $2 }
END { print (appv != "" ? appv : ver) }
'
}

entries_file=$(mktemp)
changed_names=()
first_dep=""
first_ver=""
while IFS= read -r dep; do
subchart="${{ steps.chart.outputs.chart_dir }}/charts/${dep}/Chart.yaml"
if [[ ! -f "${subchart}" ]]; then
echo "warning: ${subchart} not found, skipping ${dep}" >&2
continue
fi

new_version=$(grep -E "^appVersion:" "${subchart}" | awk '{print $NF}' || true)
old_version=$(git show origin/main:"${subchart}" 2>/dev/null \
| grep -E "^appVersion:" | awk '{print $NF}' || true)
new_version=$(chart_version < "${subchart}")
old_version=$(git show origin/main:"${subchart}" 2>/dev/null | chart_version || true)

# Strip surrounding quotes Helm allows around appVersion (e.g. "0.44.0").
# Strip surrounding quotes Helm allows around the version (e.g. "0.44.0").
new_version="${new_version//[\"\']/}"
old_version="${old_version//[\"\']/}"

Expand All @@ -173,9 +186,30 @@ jobs:

[[ "${new_version}" != v* ]] && new_version="v${new_version}"
echo "- Updated \`${dep}\` to upstream version \`${new_version}\`." >> "${entries_file}"
changed_names+=("${dep}")
if [[ ${#changed_names[@]} -eq 1 ]]; then
first_dep="${dep}"
first_ver="${new_version}"
fi
done <<< "${deps}"

echo "entries_file=${entries_file}" >> "$GITHUB_OUTPUT"

# Build a descriptive PR title from the changed dependencies. One dep gets
# its version; a few are listed by name; many collapse to a count.
count=${#changed_names[@]}
title=""
if (( count == 1 )); then
title="chore(chart): update ${first_dep} to ${first_ver} from upstream"
elif (( count >= 2 && count <= 3 )); then
joined=$(printf '%s, ' "${changed_names[@]}"); joined="${joined%, }"
title="chore(chart): update ${joined} from upstream"
elif (( count > 3 )); then
title="chore(chart): update ${count} dependencies from upstream"
fi
if [[ -n "${title}" ]]; then
echo "title=${title}" >> "$GITHUB_OUTPUT"
fi
- name: Run changelogger
id: changelogger
run: |
Expand Down Expand Up @@ -229,6 +263,7 @@ jobs:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
ENTRIES: ${{ needs.sync-and-update.outputs.entries }}
DRIFT: ${{ needs.sync-and-update.outputs.drift }}
TITLE: ${{ needs.sync-and-update.outputs.title }}
run: |
body=""
if [[ -n "${ENTRIES}" ]]; then
Expand All @@ -254,6 +289,11 @@ jobs:
body+=$'\n```\n'
fi
fi
title_args=()
if [[ -n "${TITLE}" ]]; then
title_args=(--title "${TITLE}")
fi
gh pr edit '${{ inputs.update_branch }}' \
--repo ${{ github.repository }} \
"${title_args[@]}" \
--body "${body}"
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
however this project does not use Semantic Versioning and there are no releases.
Instead this file uses a date-based structure.

## 2026-07-06

### Fixed

- `sync-from-upstream.yaml` — the dependency-version detection step now falls back to a subchart's `version:` field when `appVersion:` is not set, instead of skipping the dependency. Subcharts vendored without an `appVersion` (e.g. `giantswarm/kyverno-crds`) were always reported as "No version change", so `CHANGELOG.md` was never updated by the automated upstream-sync PR. Extraction also tolerates a trailing `# VERSION` comment on the `version:` line.

### Changed

- `sync-from-upstream.yaml` — the automated PR title now names the updated dependencies instead of a static "automated update from upstream". A single change reads `chore(chart): update <dep> to <version> from upstream`; two or three list the names; more than three collapse to `chore(chart): update N dependencies from upstream`.

## 2026-07-02

### Added
Expand Down