Skip to content

Commit

Permalink
fixup: use strenv to properly add Artifact Hub annotation (#950)
Browse files Browse the repository at this point in the history
  • Loading branch information
lemeurherve authored Nov 23, 2023
1 parent 45203bf commit 73740d7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,15 @@ jobs:
run: |
# Remove first line if empty and replace emojis by spaces (issue with yq/chart-releaser which break multiline)
# shellcheck disable=SC2016
stripped_changelog=$(echo "$CHANGELOG" | sed -e '2,$b' -e '/^$/d' | iconv -c -f utf8 -t ascii)
stripped_changelog=$(echo "${CHANGELOG}" | sed -e '2,$b' -e '/^$/d' | iconv -c -f utf8 -t ascii)
# Remove leading spaces
stripped_changelog="${stripped_changelog#"${stripped_changelog%%[![:space:]]*}"}"
# Update chart annotations
yq --inplace ".annotations.\"artifacthub.io/changes\" = \"${stripped_changelog}\"" charts/jenkins/Chart.yaml
# Add new line to ensure scalar value in Chart.yaml
printf -v change '%s\n' "${stripped_changelog}"
# Update chart annotations using strenv operator (https://mikefarah.gitbook.io/yq/operators/string-operators#string-blocks-bash-and-newlines)
CHANGE="${change}" yq --inplace ".annotations.\"artifacthub.io/changes\" = strenv(CHANGE)" charts/jenkins/Chart.yaml
- name: Show updated Chart.yaml
run: |
Expand Down
4 changes: 4 additions & 0 deletions charts/jenkins/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Use the following links to reference issues, PRs, and commits prior to v2.6.0.
The changelog until v1.5.7 was auto-generated based on git commits.
Those entries include a reference to the git commit to be able to get more details.

## 4.8.5

Fix `artifacthub.io/changes` changelog annotation added to the released chart.

## 4.8.4

Add `artifacthub.io/changes` changelog annotation to the released chart.
Expand Down
2 changes: 1 addition & 1 deletion charts/jenkins/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: jenkins
home: https://jenkins.io/
version: 4.8.4
version: 4.8.5
appVersion: 2.426.1
description: Jenkins - Build great things at any scale! The leading open source automation server, Jenkins provides over 1800 plugins to support building, deploying and automating any project.
sources:
Expand Down

0 comments on commit 73740d7

Please sign in to comment.