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 758c130 commit 6c3516a
Showing 1 changed file with 18 additions and 25 deletions.
43 changes: 18 additions & 25 deletions .github/workflows/vale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,30 +58,23 @@ jobs:
fi
done
- name: Run Vale and capture output
- name: Run vale
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
id: vale-lint
run: |
/home/runner/vale --output=vale-output.json ${{ steps.changed-files.outputs.all_changed_and_modified_files }} || true
- name: Check for Vale issues and exit with code 78 if found
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
id: check-vale-output
run: |
if grep -i '"severity":' vale-output.json; then
echo "Vale found issues."
exit 78 # Exit with code 78 to mark the job as neutral
else
echo "No issues found."
fi
continue-on-error: true
uses: errata-ai/vale-action@reviewdog
with:
token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-check
files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }}
separator: ' '
version: '2.27.0'

- name: Post summary comment if Vale finds issues
if: steps.check-vale-output.outcome == 'neutral' # Check if the step exited with code 78
run: |
COMMENT="❗️Oh no, some Vale linting issues were found! Please check the **Files changed** tab for detailed results and make the necessary updates."
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 }}
# - name: Post summary comment
# if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
# run: |
# COMMENT="❗️Oh no, some Vale linting found issues! Please check the **Files change** tab for detailed results and make the necessary updates."
# 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 6c3516a

Please sign in to comment.