Files
onyx/.github/workflows/pr-helm-chart-version.yml

63 lines
2.5 KiB
YAML

name: Helm Chart Version Check
concurrency:
group: Helm-Chart-Version-Check-${{ github.workflow }}-${{ github.head_ref || github.event.workflow_run.head_branch || github.run_id }}
cancel-in-progress: true
# Requires deployment/helm/charts/onyx/Chart.yaml `version` to be bumped above the
# version on main and release descriptions updated whenever the chart changes.
# helm-chart-releases.yml republishes the chart on every push to main that touches the charts, and will
# NOT overwrite an already-published version, so a chart change that reuses
# main's version is silently never released. This gate prevents that.
#
# Uses native path filtering for chart files and the release checker
# itself (onyx-cnpg-crds is bundled into the onyx chart via Chart.lock, so it
# counts too). Because of this it cannot be a *required* branch-protection check
# -- a required check that is filtered out on unrelated PRs stays stuck "pending"
# and blocks merges. It is enforced as a visible failing check on chart PRs.
#
# Runs on PRs into any branch except release/** (a stacked PR still needs a
# version above main, because that is where the chart publishes from). Release
# branches never publish the chart, so the check does not apply there.
on:
pull_request:
branches-ignore: ["release/**"]
paths:
- "deployment/helm/charts/onyx/**"
- "deployment/helm/charts/onyx-cnpg-crds/**"
- "tools/helm/**"
- ".pre-commit-config.yaml"
- ".github/workflows/pr-helm-chart-version.yml"
permissions:
contents: read
jobs:
helm-chart-version-check:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # ratchet:actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # ratchet:actions/setup-python@v7.0.0
with:
python-version: "3.13"
- name: Test the Helm release checker
run: |
python -m pip install PyYAML==6.0.3 semver==3.0.4
python -m unittest discover -s tools/helm -v
- name: Refresh main release baseline
run: git fetch --no-tags origin +refs/heads/main:refs/remotes/origin/main
- name: Require chart version and release description updates
uses: j178/prek-action@4e14d07f9231acabce116ccfca13b13dd9755ece
with:
prek-version: '0.3.4'
extra-args: helm-release --all-files