-
Notifications
You must be signed in to change notification settings - Fork 3
41 lines (41 loc) · 1.33 KB
/
ci-apps-kpt.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: ci-apps-kpt
on:
push:
branches:
- main
paths-ignore:
- '**/README.md'
- 'docs/**'
- '.github/workflows/ci-apps-gator.yaml'
- '.github/workflows/ci-policies.yaml'
pull_request:
paths-ignore:
- '**/README.md'
- 'docs/**'
- '.github/workflows/ci-apps-gator.yaml'
- '.github/workflows/ci-policies.yaml'
jobs:
kpt:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: install kpt
run: |
curl -L https://github.com/GoogleContainerTools/kpt/releases/download/v${KPT_VERSION}/kpt_linux_amd64 > kpt
chmod +x kpt
env:
KPT_VERSION: 1.0.0-beta.32
- name: gatekeeper
id: gatekeeper
run: |
./kpt fn eval . --image gcr.io/kpt-fn/gatekeeper:v0.2 --results-dir tmp
- name: gatkeeper errors in summary
if: ${{ failure() && steps.gatekeeper.outcome == 'failure' }}
run: |
if [ -f tmp/results.yaml ]; then
echo "❌ gatekeeper errors:" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat tmp/results.yaml | yq -r '.items[]?.results' -o json | jq -r '.[]? | "➡️ \(.message)"' | sed 's/<//g;s/>//g' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
rm tmp/results.yaml
fi