-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de5eb19
commit 2b7ae82
Showing
10 changed files
with
162 additions
and
80 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# DO NOT EDIT. Generated with: | ||
# | ||
# devctl@5.0.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" | ||
base_ref=${GITHUB_BASE_REF##*/} | ||
head_ref=${GITHUB_HEAD_REF##*/} | ||
echo "Comparing ${base_ref}...${head_ref}" | ||
changed_files=$(gh api repos/{owner}/{repo}/compare/${base_ref}...${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" |
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
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
Oops, something went wrong.