Skip to content

Update values.yaml

Update values.yaml #85

name: Check chart version bump
on:
pull_request:
jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: list_modified_chart_folders
name: List modified chart folders
env:
GH_TOKEN: ${{ github.token }}
run: |
# Retrive the list of modifed chart folders from the pull request changes
gh pr view ${{ github.event.pull_request.number }} --json files -q '.files[].path' | grep "^charts/" | xargs dirname | cut -d "/" -f 2 | sort --unique > modified_chart_folders.txt
# Store the modified folders as a step output
{
echo 'modified_chart_folders<<EOF'
cat modified_chart_folders.txt
echo EOF
} >> "$GITHUB_ENV"
- id: check_bump
name: Check if chart version has been bumped
run: |
git checkout -b $GITHUB_BASE_REF
git checkout -b $GITHUB_HEAD_REF
for folder in $modified_chart_folders; do
MAIN_CHART_VERSION=$(git show $GITHUB_BASE_REF:charts/$folder/Chart.yaml | grep "^version:")
PR_CHART_VERSION=$(git show $GITHUB_HEAD_REF:charts/$folder/Chart.yaml | grep "^version:")
if [ "$MAIN_CHART_VERSION" != "$PR_CHART_VERSION" ]; then
echo "ERROR: the version '$PR_CHART_VERSION' of the '${folder}' chart hasn't been bumped."
exit 1
fi
echo "The version of the '${folder}' chart has been bumped."
done