Skip to content

Commit 1ced558

Browse files
authored
Merge pull request #54 from OS2borgerPC/53-update-pipeline-with-iso-download-information
issue #53 - update release notes instead of replacement
2 parents 9b5f574 + 4adfce2 commit 1ced558

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/build_iso.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
echo "FILENAME=borgerpc-kiosk-amd64-dev" >> $GITHUB_ENV
4545
fi
4646
47-
- name: Build OS2borgerpc image
47+
- name: Build OS2borgerpc Kiosk image
4848
run: |
4949
cd image && ./build_os2borgerpc_kiosk_image.sh ../${{ env.UBUNTU_ISO_FILENAME }} $FILENAME
5050
@@ -63,12 +63,22 @@ jobs:
6363
AWS_ACCESS_KEY_ID: ${{ secrets.HETZNER_OS2BORGERPC_ACCESS_KEY }}
6464
AWS_SECRET_ACCESS_KEY: ${{ secrets.HETZNER_OS2BORGERPC_SECRET_KEY }}
6565

66-
- name: Add download URL to release notes
66+
- name: Append download URL to release notes
6767
if: github.event_name == 'release'
6868
run: |
69+
# Fetch the current release notes
70+
CURRENT_BODY=$(curl -s \
71+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
72+
https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }} \
73+
| jq -r .body)
74+
75+
# Update the release notes with new content appended, jq used to escape the JSON properly.
6976
DOWNLOAD_URL="https://fsn1.your-objectstorage.com/os2borgerpc/borgerpc-os-images/${{ env.FILENAME }}.iso"
77+
UPDATED_BODY=$(printf "%s\r\n## Download the ISO\r\n%s" "$CURRENT_BODY" "$DOWNLOAD_URL" | jq -Rs .)
78+
79+
# Patch the release notes
7080
curl -X PATCH \
7181
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
7282
-H "Content-Type: application/json" \
73-
-d "{\"body\": \"Download the ISO here: $DOWNLOAD_URL\"}" \
83+
-d "{\"body\": $UPDATED_BODY}" \
7484
https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}

0 commit comments

Comments
 (0)