Skip to content

Commit

Permalink
add skip
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 committed Oct 18, 2024
1 parent af07b90 commit 6196f7c
Showing 1 changed file with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions .github/workflows/vale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,42 +39,41 @@ jobs:
website/**/*.md
separator: ' '

- name: Debugging - Print changed files
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
- name: Filter out deleted files
id: filter-files
run: |
echo "Changed files:"
echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}"
# Separate the changed files into deleted and non-deleted
CHANGED_FILES="${{ steps.changed-files.outputs.all_changed_and_modified_files }}"
DELETED_FILES="${{ steps.changed-files.outputs.deleted_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
# Filter out the deleted files
FILES_TO_LINT=""
for file in $CHANGED_FILES; do
if [[ ! " $DELETED_FILES " =~ " $file " ]]; then
FILES_TO_LINT+="$file "
fi
done
- name: Run vale
# Trim trailing whitespace and set the output
FILES_TO_LINT=$(echo "$FILES_TO_LINT" | xargs)
echo "files_to_lint=$FILES_TO_LINT" >> $GITHUB_OUTPUT
- name: Debugging - Print files to lint
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
run: |
echo "Files to lint:"
echo "${{ steps.filter-files.outputs.files_to_lint }}"
- name: Run Vale
if: ${{ steps.filter-files.outputs.files_to_lint != '' }}
uses: errata-ai/vale-action@reviewdog
with:
token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-check
files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }}
files: ${{ steps.filter-files.outputs.files_to_lint }}
separator: ' '
version: '2.27.0'

# - 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 }}
- name: Skip Vale linting
if: ${{ steps.filter-files.outputs.files_to_lint == '' }}
run: echo "No files to lint, skipping Vale."

0 comments on commit 6196f7c

Please sign in to comment.