From 12209d58448edbdb13190b8f9e025bddc6f369c5 Mon Sep 17 00:00:00 2001 From: Ian Roberts Date: Thu, 23 Feb 2023 19:03:12 +0000 Subject: [PATCH] Add a summary job that succeeds if either no charts were changed, or all the checks on changed charts succeeded. This can then be used as a branch protection check to block merging if the charts are invalid. --- .github/workflows/pr-checks.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/pr-checks.yaml b/.github/workflows/pr-checks.yaml index d8a26e1..43c524b 100644 --- a/.github/workflows/pr-checks.yaml +++ b/.github/workflows/pr-checks.yaml @@ -88,3 +88,30 @@ jobs: helm dependency build helm package . + + # Final job to summarize the matrix, so it can be used in branch protection rules + charts-ok: + runs-on: ubuntu-latest + needs: check-chart + if: always() + + steps: + - name: Some chart failed + if: needs.check-chart.result == 'failure' + run: | + echo "One or more charts failed validation" + exit 1 + + - name: Chck was cancelled + if: needs.check-chart.result == 'cancelled' + run: | + echo "Chart validation was cancelled" + exit 1 + + - name: All charts OK + if: needs.check-chart.result == 'success' + run: echo "All charts are OK" + + - name: No charts were modified + if: needs.check-chart.result == 'skipped' + run: echo "No charts were modified by this PR"