Skip to content

Commit

Permalink
Separate in different steps
Browse files Browse the repository at this point in the history
  • Loading branch information
pitag-ha committed Nov 15, 2023
1 parent af1edd7 commit 4e57e02
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions .github/workflows/comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,38 @@ jobs:
issues: write
pull-requests: write
steps:
- name: Write comment on PR
- name: Write HTTP body to file
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
workflow_run: <workflow_run_id>
diff_id: <diff_id>
message: |
This PR introduces a change in some Merlin query response(s), which has been captured by the fuzzy-test CI. The fuzzy-test diffs of the CI have been approved. Info about the diffs that have been approved:
- Distilled data:
- Diff: https://github.com/pitag-ha/merlin/suites//artifacts/
- Diff 256-sha: {{ steps.category_data_diff_hash.outputs.hash }}
- Data on target branch (`master` at (...)): (...)
- Data on PR merge branch, i.e. merge result of source branch (at (...)) and target branch: (...)
- Full responses:
- Diff: (...)
- Diff 256-sha: my-full-responses-sha
- Data on target branch (`master` at (...)): (...)
- Data on PR merge branch, i.e. merge result of source branch (at (...)) and target branch: (...)
msg: Hi
# This PR introduces a change in some Merlin query response(s), which has been captured by the fuzzy-test CI. The fuzzy-test diffs of the CI have been approved. Info about the diffs that have been approved:
# - Distilled data:
# - Diff: https://github.com/pitag-ha/merlin/suites//artifacts/
# - Diff 256-sha: {{ steps.category_data_diff_hash.outputs.hash }}
# - Data on target branch (`master` at (...)): (...)
# - Data on PR merge branch, i.e. merge result of source branch (at (...)) and target branch: (...)
# - Full responses:
# - Diff: (...)
# - Diff 256-sha: my-full-responses-sha
# - Data on target branch (`master` at (...)): (...)
# - Data on PR merge branch, i.e. merge result of source branch (at (...)) and target branch: (...)
run: |
echo "$message"
body=$( echo "$message" | jq -Rsa . )
# body=$( echo "Hi" | jq -Rsa . )
body="Hi"
echo $body
printf '{"body": "%s"}' "$body" > body.json
curl -LsX POST -H "Authorization: Bearer $GITHUB_TOKEN" -d body.json https://api.github.com/repos/pitag-ha/merlin/issues/6/comments
echo "'{"body": "'"$body"'"}'"
jq -n --arg msg "$msg" '{ body: $msg }' | tee -a body.json
# printf '{"body": "%s"}' "$body" | jq -Rsa . | tee -a body.json
- name: Cat file
run: cat body.json

- name: Write comment on PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -LsX POST -H "Authorization: Bearer $GITHUB_TOKEN" -d @body.json https://api.github.com/repos/pitag-ha/merlin/issues/6/comments
# echo "'{"body": "'"$body"'"}'"
echo $?
# run: |
Expand Down

0 comments on commit 4e57e02

Please sign in to comment.