Skip to content

Commit

Permalink
ci: JQ json-safety
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanFreestone committed Sep 17, 2024
1 parent 076d302 commit be3f8f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/validate-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ jobs:
retention-days: 1
- name: Setup validate_module_descriptor_errors file
if: failure()
run: echo "$(cat validate_module_descriptor_output.txt)" | tee | grep "\[ERROR\]" 2>&1 | tee validate_module_descriptor_errors.txt
## Make sure we convert to JSON-safe text before we try to send later
run: echo "$(cat validate_module_descriptor_output.txt)" | tee | grep "\[ERROR\]" | jq -R 2>&1 | tee validate_module_descriptor_errors.txt
- name: Comment failures on PR
if: failure()
run: |
Expand All @@ -68,4 +69,4 @@ jobs:
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
COMMENT_URL="https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"
echo "SENDING TO: $COMMENT_URL"
curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST $COMMENT_URL --data "@validate_module_descriptor_errors.txt"
curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST $COMMENT_URL --data-binary "{ \"body\": \"$(cat validate_module_descriptor_errors.txt)\" }"

0 comments on commit be3f8f2

Please sign in to comment.