Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 committed Oct 15, 2024
1 parent dcfb9c5 commit 2042e0e
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/vale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
echo "Changed files:"
echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}"
- name: Run Vale with reviewdog and capture output
- name: Run Vale with reviewdog
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
id: vale-lint
uses: errata-ai/vale-action@reviewdog
Expand All @@ -58,18 +58,12 @@ jobs:
version: '2.27.0'

- name: Post summary comment if Vale warnings found
if: ${{ always() }}
if: ${{ steps.vale-lint.outputs.github_check.conclusion != 'success' }}
run: |
# Check if any warnings were reported by Vale
vale_warnings=$(gh run view --log | grep -i "WARNING")
if [ -n "$vale_warnings" ]; then
COMMENT="❗️ Vale linting has detected warnings in your PR! Please check the **Files changed** tab for detailed results and address them."
COMMENT+=$'\n'
COMMENT+=$'\n\n'
COMMENT+="➡️ Link to detailed report: [Files changed](${{ github.event.pull_request.html_url }}/files)"
gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT"
else
echo "No warnings found, skipping comment."
fi
COMMENT="❗️ Vale linting has detected warnings in your PR! Please check the **Files changed** tab for detailed results and address them."
COMMENT+=$'\n'
COMMENT+=$'\n\n'
COMMENT+="➡️ Link to detailed report: [Files changed](${{ github.event.pull_request.html_url }}/files)"
gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 2042e0e

Please sign in to comment.