Skip to content

Commit

Permalink
remove test task; fix headers on collapse call
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-mm committed Nov 2, 2023
1 parent 96091e9 commit 4a9e053
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ runs:
using: 'composite'
steps:
- id: guard
if: inputs.task != 'start-measurement' && inputs.task != 'get-measurement' && inputs.task != 'display-results' && inputs.task != 'test'
if: inputs.task != 'start-measurement' && inputs.task != 'get-measurement' && inputs.task != 'display-results'
shell: bash
run: |
echo 'Please call the Eco-CI Energy Estimation with a valid task name: start-measurement, get-measurement, or display-results' >> $GITHUB_STEP_SUMMARY
Expand Down Expand Up @@ -152,7 +152,7 @@ runs:
total_data_file="/tmp/eco-ci/total-data.json"
echo "data-total-json=$(cat $total_data_file)" >> $GITHUB_OUTPUT
- if: github.event_name == 'pull_request' && inputs.task == 'test' && inputs.pr-comment == 'true'
- if: github.event_name == 'pull_request' && inputs.pr-comment == 'true'
name: Minimize Old Comment and Post New Comment
id: minimize-comment
shell: bash
Expand All @@ -166,7 +166,7 @@ runs:
# remove "<details><summary>Collapsed comment</summary>\n\n" and "\n\n</details>" from the comment body if its already there
COMMENT_BODY=$(echo "$COMMENT_BODY" | sed 's/<details><summary>Old Energy Estimation<\/summary>//g' | sed 's/<\/details>//g')
PAYLOAD=$(jq --null-input --arg body "<details><summary>Old Energy Estimation</summary>$COMMENT_BODY</details>" '{"body": $body}')
curl -s -H "$HEADER" -H "$ACCEPT_HEADER" -X PATCH -d "$PAYLOAD" "https://api.github.com/repos/${{ github.repository }}/issues/comments/$COMMENT_ID"
curl -s -H "Authorization: Bearer ${{github.token}}" -X PATCH -d "$PAYLOAD" "https://api.github.com/repos/${{ github.repository }}/issues/comments/$COMMENT_ID"
echo "Comment $COMMENT_ID collapsed."
done
Expand Down

0 comments on commit 4a9e053

Please sign in to comment.