errata-ai / vale-action

:octocat: The official GitHub Action for Vale -- install, manage, and run Vale with ease.
MIT License
198 stars 47 forks source link

Permission issues when vale-action runs on latest after v3 CLI release #114

Closed carolstran closed 8 months ago

carolstran commented 8 months ago

Description

Following the Vale CLI v3.0.0 release, we've noticed the vale-action runs into permissions issues that causes the workflow to pass even when errors are present and fail_on_error is true.

This happens right after the workflow runs vale with reviewdog:

Screenshot 2024-01-11 at 17 01 30

[!WARNING] You also have the same issue in your runner / vale job run on the Vale CLI repo.

Screenshot (in case the logs expire) Screenshot 2024-01-11 at 15 46 09

I opened a pull request with known issues and used tmate to reproduce the action. Then when running the same command (but with sudo permissions), it produces the expected output.

Screenshot of tmate repro output Screenshot 2024-01-11 at 15 57 37

Vale versions

Example outputs

3.0.0

Shows mkdir /.local: permission denied

Job logs

Screenshot (in case the logs expire) Screenshot 2024-01-11 at 14 48 19

2.30.0

Works as expected (this run should fail because there are known errors in this PR)

Job logs

Screenshot (in case the logs expire) Screenshot 2024-01-11 at 17 17 08

Environment

My default workflow (source code):

jobs:
  vale:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: errata-ai/vale-action@reviewdog
        with:
          fail_on_error: true
          vale_flags: "--minAlertLevel=error"
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN Permissions
  Actions: write
  Checks: write
  Contents: write
  Deployments: write
  Discussions: write
  Issues: write
  Metadata: read
  Packages: write
  Pages: write
  PullRequests: write
  RepositoryProjects: write
  SecurityEvents: write
  Statuses: write

I've also tried...

jdkato commented 8 months ago

This should be fixed now.

carolstran commented 8 months ago

@jdkato Thanks so much! Out of curiosity, what was the issue and which commit fixed it?