Compare commits

...

2 Commits

Author SHA1 Message Date
863c3a30c1
fix(Chart): escape changelog messages for artifacthub
Some checks failed
Helm / helm-unittest (push) Successful in 17s
Helm / helm-lint (push) Successful in 24s
Release / publish-chart (push) Failing after 18s
2025-06-06 22:01:12 +02:00
c9a45d8040
chore(deps): update dependency volker.raschek/prometheus-fail2ban-exporter-charts to v0.4.16
All checks were successful
Generate README / generate-parameters (pull_request) Successful in 45s
Helm / helm-lint (pull_request) Successful in 16s
Helm / helm-unittest (pull_request) Successful in 15s
Markdown linter / markdown-link-checker (pull_request) Successful in 30s
Markdown linter / markdown-lint (pull_request) Successful in 33s
Helm / helm-lint (push) Successful in 25s
Generate README / generate-parameters (push) Successful in 30s
Helm / helm-unittest (push) Successful in 24s
Markdown linter / markdown-link-checker (push) Successful in 32s
Markdown linter / markdown-lint (push) Successful in 46s
2025-06-04 19:11:43 +00:00
3 changed files with 17 additions and 13 deletions

View File

@ -54,7 +54,8 @@ else
fi
fi
YAML_FILE=$(mktemp)
CHANGE_LOG_YAML=$(mktemp)
echo "[]" > "${CHANGE_LOG_YAML}"
function map_type_to_kind() {
case "${1}" in
@ -86,25 +87,28 @@ echo "INFO: Generate change log entries from ${OLD_TAG} until ${NEW_TAG}"
while IFS= read -r line; do
if [[ "${line}" =~ ^([a-zA-Z]+)(\([^\)]+\))?\:\ (.+)$ ]]; then
TYPE="${BASH_REMATCH[1]}"
KIND=$(map_type_to_kind "${TYPE}")
if [ "${TYPE}" == "skip" ]; then
if [ "${KIND}" == "skip" ]; then
continue
fi
DESC="${BASH_REMATCH[3]}"
KIND=$(map_type_to_kind "${TYPE}")
echo "- ${KIND}: ${DESC}"
yq --inplace ". += [ {\"kind\": \"${KIND}\", \"description\": \"${DESC}\"}]" "${YAML_FILE}"
jq --arg kind changed --arg description "$DESC" '. += [ $ARGS.named ]' < ${CHANGE_LOG_YAML} > ${CHANGE_LOG_YAML}.new
mv ${CHANGE_LOG_YAML}.new ${CHANGE_LOG_YAML}
fi
done <<< "${COMMIT_TITLES}"
if [ -s "${YAML_FILE}" ]; then
yq --no-colors --inplace ".annotations.\"artifacthub.io/changes\" |= loadstr(\"${YAML_FILE}\") | sort_keys(.)" "${CHART_FILE}"
if [ -s "${CHANGE_LOG_YAML}" ]; then
yq --inplace --input-format json --output-format yml "${CHANGE_LOG_YAML}"
yq --no-colors --inplace ".annotations.\"artifacthub.io/changes\" |= loadstr(\"${CHANGE_LOG_YAML}\") | sort_keys(.)" "${CHART_FILE}"
else
echo "ERROR: Changelog file is empty: ${YAML_FILE}" 1>&2
echo "ERROR: Changelog file is empty: ${CHANGE_LOG_YAML}" 1>&2
exit 1
fi
rm "${YAML_FILE}"
rm "${CHANGE_LOG_YAML}"

View File

@ -14,7 +14,7 @@ jobs:
- name: Install tooling
run: |
apk update
apk add git npm yq
apk add git npm jq yq
- uses: actions/checkout@v4
with:
@ -22,8 +22,8 @@ jobs:
- name: Add Artifacthub.io annotations
run: |
NEW_TAG="$(git tag --sort=-version:refname | head -n 1)"
OLD_TAG="$(git tag --sort=-version:refname | head -n 2 | tail -n 1)"
NEW_TAG="$(git tag --sort=-version:refname | head --lines 1)"
OLD_TAG="$(git tag --sort=-version:refname | head --lines 2 | tail --lines 1)"
.gitea/scripts/add-annotations.sh "${OLD_TAG}" "${NEW_TAG}"
- name: Package chart

View File

@ -42,7 +42,7 @@ version of the chart must be in sync with the `values.yaml`. Newer *minor* versi
versions can break something!
```bash
CHART_VERSION=0.4.11
CHART_VERSION=0.4.16
helm show values prometheus-exporters/prometheus-fail2ban-exporter --version "${CHART_VERSION}" > values.yaml
```