mirror of
https://github.com/bitnami/charts.git
synced 2026-03-07 16:17:21 +08:00
[bitnami/*] test: fixed bump detection (#9069)
* [bitnami/*] test: fixed bump detection ref: bitnami/charts#9062 -- The script compared with the head repo, not base; now using data from the API response to detect bumps Signed-off-by: Marcello Pontes <balaum@gmail.com> * [bitnami/*] removed extra char on bump detection Signed-off-by: Marcello Pontes <balaum@gmail.com>
This commit is contained in:
5
.github/workflows/vib-early-feedback.yaml
vendored
5
.github/workflows/vib-early-feedback.yaml
vendored
@@ -28,12 +28,13 @@ jobs:
|
||||
# Using the Github API to detect the files changed as git merge-base stops working when the branch is behind
|
||||
# and jitterbit/get-changed-files does not support pull_request_target
|
||||
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files"
|
||||
files_changed="$(curl -s --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -X GET -G "$URL" | jq -r '.[] | .filename')"
|
||||
files_changed_data=$(curl -s --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -X GET -G "$URL" | sed 's/\\/\\\\/g')
|
||||
files_changed="$(echo $files_changed_data | jq -r '.[] | .filename')"
|
||||
# Adding || true to avoid "Process exited with code 1" errors
|
||||
charts_dirs_changed="$(echo "$files_changed" | xargs dirname | grep -o "bitnami/[^/]*" | sort | uniq || true)"
|
||||
# Using grep -c as a better alternative to wc -l when dealing with empty strings."
|
||||
num_charts_changed="$(echo "$charts_dirs_changed" | grep -c "bitnami" || true)"
|
||||
num_version_bumps="$(echo "$files_changed" | grep Chart.yaml | xargs git diff origin/master | grep -c "+version" || true)"
|
||||
num_version_bumps="$(echo "$files_changed_data" | jq -r '[.[] | select(.filename|endswith("Chart.yaml")) | select(.patch|contains("+version")) ] | length' )"
|
||||
|
||||
if [[ "$num_charts_changed" -ne "$num_version_bumps" ]]; then
|
||||
# Changes done in charts but version not bumped -> ERROR
|
||||
|
||||
Reference in New Issue
Block a user