Skip to content

Commit e318071

Browse files
chore(ci): patch release note write (#1241)
<!-- markdownlint-disable MD041 --> #### What this PR does / why we need it This is a final correction to the release notes writer that makes sure the newlines are kept without using base64 but still maintaining that only the body is forwarded to avoid secret leaks #### Which issue(s) this PR fixes <!-- Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> fix open-component-model/ocm-project#363 already fixed in releases/v0.19 as I used this branch to test this fix.
1 parent 7264f85 commit e318071

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/release.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
RELEASE_VERSION_NO_SUFFIX: ${{ needs.release-version.outputs.version_no_suffix }}
3737
REF: ${{ github.ref }}
3838
outputs:
39-
draft-release-notes-body-base64: ${{ steps.release-notes.outputs.release_notes_body_base64 }}
39+
draft-release-notes-body: ${{ steps.release-notes.outputs.release_notes_body }}
4040
steps:
4141
- name: Checkout
4242
uses: actions/checkout@v4
@@ -68,17 +68,20 @@ jobs:
6868
env:
6969
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
7070
run: |
71-
RELEASE_BODY_BASE64=$( \
71+
RELEASE_BODY=$( \
7272
gh api /repos/${{ github.repository }}/releases \
7373
-q '.[] | select(.name == "${{ env.RELEASE_VERSION_NO_SUFFIX }}" and .draft == true) | .body' \
74-
| base64 \
7574
)
76-
echo "release_notes_body_base64=${RELEASE_BODY_BASE64}" >> $GITHUB_OUTPUT
7775
# if no draft release notes are found, we cannot continue
78-
if [ -z "${RELEASE_BODY_BASE64}" ]; then
76+
if [ -z "${RELEASE_BODY}" ]; then
7977
echo "No draft release notes found for ${{ env.RELEASE_VERSION_NO_SUFFIX }}"
8078
exit 1
8179
fi
80+
{
81+
echo 'release_notes_body<<EOF'
82+
echo "${RELEASE_BODY}"
83+
echo 'EOF'
84+
} >> $GITHUB_OUTPUT
8285
components:
8386
name: Component CTF Builds
8487
uses: ./.github/workflows/components.yaml
@@ -211,7 +214,10 @@ jobs:
211214
212215
- name: Setup Release Notes as File to make it readable by GoReleaser
213216
run: |
214-
base64 -d <<< "${{ needs.check.outputs.draft-release-notes-body-base64 }}" > $RUNNER_TEMP/RELEASE_NOTES.md
217+
touch $RUNNER_TEMP/RELEASE_NOTES.md
218+
cat > $RUNNER_TEMP/RELEASE_NOTES.md << EOF
219+
${{ needs.check.outputs.draft-release-notes-body }}
220+
EOF
215221
echo "RELEASE_NOTES=$RUNNER_TEMP/RELEASE_NOTES.md" >> $GITHUB_ENV
216222
cat $RUNNER_TEMP/RELEASE_NOTES.md
217223
- name: Run GoReleaser

0 commit comments

Comments
 (0)