Skip to content

Commit

Permalink
Add a summary job that succeeds if either no charts were changed, or …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
ianroberts committed Feb 23, 2023
1 parent 28f58c2 commit 12209d5
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 12209d5

Please sign in to comment.