-
-
Notifications
You must be signed in to change notification settings - Fork 83
36 lines (31 loc) · 1.01 KB
/
simple-checks.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
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Simple Checks"
on:
workflow_call:
jobs:
metadata-validation:
name: Validate Image Metadata
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files_yaml: |
cue:
- metadata.rules.cue
- apps/**/metadata.yaml
- name: Setup CUE
if: ${{ steps.changed-files.outputs.cue_any_changed == 'true' }}
uses: cue-lang/[email protected]
# Run against all files to ensure they are tested if the cue schema is changed.
- name: Validate image metadata
if: ${{ steps.changed-files.outputs.cue_any_changed == 'true' }}
shell: bash
run: |
find ./apps/ -name metadata.yaml | xargs -I {} cue vet --schema '#Spec' {} ./metadata.rules.cue