Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Update giantswarm modules #181

Update giantswarm modules

Update giantswarm modules #181

# DO NOT EDIT. Generated with:
#
# devctl@5.3.0
#
name: 'Check if values schema file has been updated'
on: pull_request
jobs:
check:
name: 'Check values.yaml and its schema in PR'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Check if values.schema.json was updated'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VALUES_FILE_CHANGED="false"
SCHEMA_FILE_CHANGED="false"
echo "Comparing ${GITHUB_BASE_REF}...${GITHUB_HEAD_REF}"
changed_files=$(gh api "repos/{owner}/{repo}/compare/${GITHUB_BASE_REF}...${GITHUB_HEAD_REF}" --jq ".files[] | .filename")
if grep -q "values.schema.json" <<< $(git ls-tree -r --name-only ${GITHUB_SHA}); then
if grep -q "values.yaml" <<< "${changed_files}" ; then
VALUES_FILE_CHANGED="true"
fi
if grep -q "values.schema.json" <<< "${changed_files}" ; then
SCHEMA_FILE_CHANGED="true"
fi
if [ $VALUES_FILE_CHANGED != $SCHEMA_FILE_CHANGED ]; then
echo "FAILED: values.yaml was updated but values.schema.json hasn't been regenerated"
echo "Please refer to this document: https://intranet.giantswarm.io/docs/organizational-structure/teams/cabbage/app-updates/helm-values-schema/"
exit 1
fi
echo "PASSED: values.yaml and values.schema.json both appear to have been updated"
exit 0
fi
echo "INFO: values.schema.json not present in this repo - nothing to do"