Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing on PRs when there is nothing for Vale to check #141

Open
1 task done
tjperry07 opened this issue Jan 30, 2025 · 1 comment
Open
1 task done

Failing on PRs when there is nothing for Vale to check #141

tjperry07 opened this issue Jan 30, 2025 · 1 comment

Comments

@tjperry07
Copy link

Check for existing issues

  • Completed

Environment

This literally just started. Vale has started failing on PRs where there isn't anything for it to check. Like if I delete some images and make a PR or update the redirects file, it will fail.

name: Vale Linter
on:
  pull_request:
  workflow_dispatch:

jobs:
  vale:
    name: vale action
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Get Changed Files
        id: get_changed_files
        uses: tj-actions/changed-files@v44
        with:
          files: |
            **.md
          separator: ","
      - name: Print Changed Markdown Files
        run: |
          echo "Changed markdown files: ${{ steps.get_changed_files.outputs.all_changed_files }}"

      - name: Vale Action
        uses: errata-ai/vale-action@reviewdog
        with:
          files: ${{ steps.get_changed_files.outputs.all_changed_files }}
          separator: ","
          filter_mode: diff_context
          reporter: github-pr-review
          fail_on_error: true
          token: ${{secrets.GITHUB_TOKEN}}
Run errata-ai/vale-action@reviewdog
  with:
    separator: ,
    filter_mode: diff_context
    reporter: github-pr-review
    fail_on_error: true
    token: ***
    version: latest
    debug: false
    level: error
Installing Vale version 'latest' ...
/usr/bin/tar xz --overwrite --warning=no-unknown-keyword --overwrite -C /home/runner -f /home/runner/work/_temp/[2](https://github.com/Coalesce-Software-Inc/public-product-documentation/actions/runs/13059677326/job/36439289183?pr=150#step:5:2)30370cd-e46f-4ba7-8bd7-d296e29c408d
Installed version '[3](https://github.com/Coalesce-Software-Inc/public-product-documentation/actions/runs/13059677326/job/36439289183?pr=150#step:5:3).9.4' into '/home/runner/vale'.
Installing ReviewDog version '0.17.0' ...
/usr/bin/tar xz --overwrite --warning=no-unknown-keyword --overwrite -C /home/runner -f /home/runner/work/_temp/bf1176c7-ed97-[4](https://github.com/Coalesce-Software-Inc/public-product-documentation/actions/runs/13059677326/job/36439289183?pr=150#step:5:4)5a8-a2d0-8bcac0e9dd25
Installed reviewdog from 'https://github.com/reviewdog/reviewdog/releases/download/v0.17.0/reviewdog_0.17.0_Linux_x8[6](https://github.com/Coalesce-Software-Inc/public-product-documentation/actions/runs/13059677326/job/36439289183?pr=150#step:5:6)_64.tar.gz' into '/home/runner/reviewdog'.
/home/runner/vale sync

                                                                                
 SUCCESS  Synced 0 package(s) to '/home/runner/work/public-product-documentation/public-product-documentation/.github/styles'.
Running vale...
  /home/runner/vale --output=/home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl 
  lstat : no such file or directory
Error: Vale and reviewdog exited with status code: 2

Describe the bug / provide steps to reproduce it

Make a PR, but don't make any changes to the /docs or any folder that Vale is supposed to check. Then merge.

@tjperry07
Copy link
Author

tjperry07 commented Jan 30, 2025

I was able to fix it by adding the check

      - if: steps.get_changed_files.outputs.all_changed_files != ''
        uses: errata-ai/[email protected]
        with:
          files: ${{ steps.get_changed_files.outputs.all_changed_files }}
          separator: ","
          filter_mode: diff_context
          reporter: github-pr-review
          fail_on_error: true
          token: ${{ secrets.GITHUB_TOKEN }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant