Skip to content

Commit

Permalink
Shell escape $BODY in the release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
justusdieckmann authored May 2, 2024
1 parent b8cf580 commit 7aef394
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/moodle-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ jobs:
steps:
- name: Call the service function
id: add-version
env:
TAGNAME: ${{ github.event.release.tag_name }}
BODY: ${{ github.event.release.body }}
ZIPURL: ${{ github.event.release.zipball_url }}
run: |
TAGNAME="${{ github.event.release.tag_name }}"
BODY="${{ github.event.release.body }}"
ZIPURL="${{ github.event.release.zipball_url }}"
RESPONSE=$(${CURL} ${ENDPOINT} --data-urlencode "wstoken=${TOKEN}" \
--data-urlencode "wsfunction=${FUNCTION}" \
--data-urlencode "moodlewsrestformat=json" \
Expand All @@ -42,7 +43,7 @@ jobs:
--data-urlencode "vcstag=${TAGNAME}" \
--data-urlencode "changelogurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commits/${TAGNAME}" \
--data-urlencode "altdownloadurl=${ZIPURL}" \
--data-urlencode "releasenotes=${BODY}" \
--data-urlencode "releasenotes=${BODY@Q}" \
--data-urlencode "releasenotesformat=4")
echo "response=${RESPONSE}" >> $GITHUB_OUTPUT
- name: Evaluate the response
Expand Down

0 comments on commit 7aef394

Please sign in to comment.