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

Annotations appear on the wrong file #120

Open CBID2 opened 7 months ago

CBID2 commented 7 months ago

Hi there! :) I’m currently testing Vale’s GitHub action before putting in this pull request. Now, in my test repo, the pushed file’s errors appear in the test logs: https://github.com/CBID2/github-actions-test-for-vale/actions/runs/8135829059/job/22231056287#step:3:194 screenshot of errors in test log

However, the annotations only on appear on the present file: screenshot of annotations on untracked file

https://github.com/CBID2/github-actions-test-for-vale/pull/17/files

How can I make the annotations appear on the file being pushed?

CollierCZ commented 4 months ago

You're running this workflow on pull_request_target events. That means it's running in the context of the branch you're trying to merge into (not the pull request itself). That means it has no idea about any files you're adding in the pull request.

I'd recommend setting up the workflow to run on pull requests against main using the GitHub token method.