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 571810b commit ba096a7
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/vale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,25 @@ jobs:
website/**/*.md
separator: ' '

- name: Debugging - Print changed files
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
run: |
echo "Changed files:"
echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}"
- name: Confirm files exist
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
run: |
echo "Checking if files exist..."
for file in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do
if [ -f "$file" ]; then
echo "Found: $file"
else
echo "File not found: $file"
exit 1
fi
done
- name: Run Vale with reviewdog
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
id: vale-lint
Expand All @@ -52,13 +71,12 @@ jobs:
separator: ' '
version: '2.27.0'

- name: Add custom summary with warnings
if: ${{ steps.vale-lint.outputs.github_check.conclusion != 'success' }}
- name: Add PR comment if Vale found issues
if: failure() # This will run only if the Vale step fails (warnings are treated as failures)
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="❗️ Vale linting found warnings. Please check the **Files changed** tab for details."
COMMENT+=$'\n\n'
COMMENT+="➡️ Link to detailed report: [Files changed](${{ github.event.pull_request.html_url }}/files)"
COMMENT+="➡️ View the details here: [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 ba096a7

Please sign in to comment.