Skip to content

Commit

Permalink
CI: Improve/stabilize lint Helm CI workflow
Browse files Browse the repository at this point in the history
Only post the `Kubeconform Output` comment (on the affected GH PR)
in case `kubeconform_min_k8s_version` OR
`kubeconform_latest_k8s_version` is failed, not when they're
`skipped` (e.g., in case a previous step fails).

Signed-off-by: Philip Schmid <[email protected]>
  • Loading branch information
PhilipSchmid committed Aug 30, 2024
1 parent ed28783 commit b4f1eb4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/lint-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
- '.github/workflows/lint-helm.yaml'
workflow_call:

permissions:
pull-requests: write

env:
MIN_K8S_VERSION: "1.23.0"
# renovate: datasource=python-version
Expand Down Expand Up @@ -51,6 +54,7 @@ jobs:

# Validate Helm chart
- name: Generate Helm chart
id: generate_helm_chart
run: |
make -C install/kubernetes
- name: Validate generated files
Expand All @@ -63,13 +67,15 @@ jobs:
# (Re-)run Kubeconform checks explicitly once again to catch specific errors in that regard (to get the STDOUT/STDERR)
- name: Run Kubeconform with minimum supported K8s version
if: success() || steps.generate_helm_chart.outcome == 'failure'
id: kubeconform_min_k8s_version
uses: mathiasvr/[email protected]
with:
shell: bash
run: |
make -C install/kubernetes kubeconform K8S_VERSION=${{ env.MIN_K8S_VERSION }}
- name: Run Kubeconform with latest K8s version
if: success() || steps.generate_helm_chart.outcome == 'failure'
id: kubeconform_latest_k8s_version
uses: mathiasvr/[email protected]
with:
Expand All @@ -79,7 +85,7 @@ jobs:
# Post Kubeconform issues as comment on the GH PR, if there are any
- name: Comment Kubeconform Output
if: failure() && (steps.kubeconform_min_k8s_version.outcome != 'success' || steps.kubeconform_latest_k8s_version.outcome != 'success')
if: failure() && (steps.kubeconform_min_k8s_version.outcome == 'failure' || steps.kubeconform_latest_k8s_version.outcome == 'failure')
uses: marocchino/sticky-pull-request-comment@v2
with:
hide_and_recreate: true
Expand Down

0 comments on commit b4f1eb4

Please sign in to comment.