Implement pss-operator #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DO NOT EDIT. Generated with: | |
# | |
# [email protected] | |
# | |
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" |