Skip to content

Commit

Permalink
Actually escape the release summary better (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz authored Sep 13, 2024
1 parent 6e7603c commit 4148322
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
TEST_RELEASE_SUMMARY: |-
Test "release" summary
* Multiple lines
jobs:
build:
name: Build test configuration for esphome:${{ matrix.esphome-version }} with ${{ matrix.manifest }} manifest
Expand All @@ -42,7 +47,7 @@ jobs:
version: ${{ matrix.esphome-version }}
platform: linux/amd64
cache: true
release-summary: 'Test "release" summary'
release-summary: ${{ env.TEST_RELEASE_SUMMARY }}
release-url: "https://github.com/esphome/build-action"
complete-manifest: ${{ matrix.manifest == 'complete' }}
- name: Write version to file
Expand Down
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ runs:
shell: bash
id: build-step
run: |-
summary=$(cat <<'ENDOFSUMMARY'
${{ inputs.release-summary }}
ENDOFSUMMARY
)
docker run --rm \
--platform ${{ inputs.platform }} \
--workdir /github/workspace \
Expand All @@ -105,7 +110,7 @@ runs:
-e HOME \
esphome:${{ inputs.version }} \
${{ inputs.yaml-file }} \
--release-summary ${{ toJSON(inputs.release-summary) }} \
--release-summary "$summary" \
--release-url "${{ inputs.release-url }}" \
--outputs-file "$GITHUB_OUTPUT" \
${{ inputs.complete-manifest == 'true' && '--complete-manifest' || '--partial-manifest' }}
Expand Down
2 changes: 1 addition & 1 deletion tests/complete-manifest-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"ota": {
"path": "test-esp32.ota.bin",
"md5": "\($md5)",
"summary": "Test \"release\" summary",
"summary": "Test \"release\" summary\n* Multiple lines",
"release_url": "https://github.com/esphome/build-action"
},
"parts": [
Expand Down
2 changes: 1 addition & 1 deletion tests/partial-manifest-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"ota": {
"path": "test-esp32.ota.bin",
"md5": "\($md5)",
"summary": "Test \"release\" summary",
"summary": "Test \"release\" summary\n* Multiple lines",
"release_url": "https://github.com/esphome/build-action"
},
"parts": [
Expand Down

0 comments on commit 4148322

Please sign in to comment.