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 14f32e4 commit e0b5c29
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions .github/workflows/vale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
fi
done
- name: Run Vale with reviewdog
- name: Run Vale with reviewdog and capture output
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
id: vale-lint
uses: errata-ai/vale-action@reviewdog
Expand All @@ -70,32 +70,15 @@ jobs:
separator: ' '
version: '2.27.0'

- name: Check if Vale output file exists
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
run: |
if [ -f "/home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl" ]; then
echo "Vale output file exists."
cat /home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl
else
echo "Vale output file not found."
exit 1
fi
- name: Check Vale JSON output for issues
- name: Check for Vale issues based on stderr output
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
id: check-vale-issues
run: |
if [ -f "/home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl" ]; then
vale_output=$(jq '.[] | select(.severity=="WARNING" or .severity=="ERROR")' /home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl)
if [[ -n "$vale_output" ]]; then
echo "Vale found issues."
echo "vale_issues=true" >> $GITHUB_ENV
else
echo "No Vale issues found."
echo "vale_issues=false" >> $GITHUB_ENV
fi
if grep -q "WARNING" <(echo "${{ steps.vale-lint.outcome }}"); then
echo "Vale found issues."
echo "vale_issues=true" >> $GITHUB_ENV
else
echo "Vale output file not found, skipping JSON check."
echo "No Vale issues found."
echo "vale_issues=false" >> $GITHUB_ENV
fi
Expand Down

0 comments on commit e0b5c29

Please sign in to comment.