feat: enable pre-commit on release pipeline and limit appversion length

This commit is contained in:
kjeld Schouten-Lebbing
2021-09-08 12:20:20 +02:00
parent 7bd2776e94
commit fa29627d04
3 changed files with 5 additions and 5 deletions

View File

@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
concurrency: gitpush
container:
image: ghcr.io/truecharts/truecharts-release:v1.2.0
image: ghcr.io/truecharts/truecharts-release:v1.3.0
steps:
- uses: actions/checkout@v2

View File

@@ -196,7 +196,7 @@ jobs:
release-test:
runs-on: ubuntu-latest
container:
image: ghcr.io/truecharts/truecharts-release:v1.2.0
image: ghcr.io/truecharts/truecharts-release:v1.3.0
steps:
- name: Cache helm repo cache
id: cache

View File

@@ -122,20 +122,20 @@ sync_tag() {
local chartname="$2"
local train="$3"
local chartversion="$4"
echo "Attempting to sync primary tag with Charts.yaml for: ${chartname}"
echo "Attempting to sync primary tag with appversion for: ${chartname}"
local tag="$(cat ${chart}/Values.yaml | grep "^ tag: " | awk -F" " '{ print $2 }')"
tag="${tag:-auto}"
tag="${tag#*release-}"
tag="${tag#*version-}"
tag="${tag#*v}"
tag="${tag:0:10}"
sed -i -e "s|appVersion: .*|appVersion: ${tag}|" "${chart}/Chart.yaml"
}
pre_commit() {
if [[ -z "$standalone" ]]; then
echo "Running pre-commit test-and-cleanup..."
# TO BE ENABLED
# pre-commit run --all ||:
pre-commit run --all ||:
# Fix sh files to always be executable
find . -name '*.sh' | xargs chmod +x
fi