Skip to content

Commit

Permalink
escape the json output for validation
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscarrollsmith committed Sep 26, 2023
1 parent 9bd427f commit 2cf3caf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ jobs:
id: test-action
uses: ./
with:
feed_url: "https://knowledgeworkersguide.substack.com/feed"
feed_url: "https://modelingmarkets.substack.com/feed"

- name: Validate JSON structure
- name: Escape and Validate JSON structure
run: |
echo 'const obj = JSON.parse(`'"${{ steps.test-action.outputs.feed }}"'`); if (!obj || !obj.rss || !obj.rss.$) { console.error("Invalid object"); process.exit(1); }' | node -e
escaped_json=$(echo "${{ steps.test-action.outputs.feed }}" | jq -c -r @uri)
echo "const obj = JSON.parse(decodeURI('$escaped_json')); if (!obj || !obj.rss || !obj.rss.$) { console.error('Invalid object'); process.exit(1); }" | node -e

0 comments on commit 2cf3caf

Please sign in to comment.