Skip to content

Commit

Permalink
chore: modify comment logic
Browse files Browse the repository at this point in the history
  • Loading branch information
robproject committed Oct 22, 2023
1 parent aee4544 commit 55b76b8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,19 @@ jobs:
cat diff_output.txt | ansi2html > diff_output.html
sed -i -n '/<pre class="ansi2html-content">/,/<\/pre>/p' diff_output.html
- name: Check for content
if: github.event_name == 'pull_request'
id: check_file
run: |
content=$(tr -d "[:space:]" < diff_output.html)
if [[ -n "$content" ]]; then
echo "::set-output name=hasContent::true"
else
echo "::set-output name=hasContent::false"
fi
- name: Post comment
if: github.event_name == 'pull_request' && $(grep -qE "\S" diff_output.html)
if: github.event_name == 'pull_request' && steps.check_file.outputs.hasContent == 'true'
uses: actions/github-script@v6
with:
script: |
Expand Down

0 comments on commit 55b76b8

Please sign in to comment.