You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We run lint-action essentially like the example in the README, with eslint and prettier. However, doing things this way seem to cause a mismatch between which commit dependencies are installed from and which commit the linting is run from, causing confusing build errors.
First, the git repository is checked out using actions/checkout@v4. This, by default, does not check out the commit that the PR branch is pointing to, but the commit that would be result of the pull request branch getting merged into main. It does so by fetching the refs/remotes/pull/NNN/merge reference (see explanation here).
Then, running from that merge commit, dependencies are installed.
But then, the lint-action does its own fetching of the remote branch and checks out the unmerged pull request branch. This is where the lint checks are run.
This mismatch of dependencies and code can cause quite a bit of confusion when you don't realize what's happening. It seems that the reason that the PR branch is checked out is that lint-action needs this to be able to push to the branch. We do not, however, use this functionality.
Would it be possible to disable the checkout unless auto_fix is set to true?
The text was updated successfully, but these errors were encountered:
We run
lint-action
essentially like the example in the README, witheslint
andprettier
. However, doing things this way seem to cause a mismatch between which commit dependencies are installed from and which commit the linting is run from, causing confusing build errors.refs/remotes/pull/NNN/merge
reference (see explanation here).lint-action
does its own fetching of the remote branch and checks out the unmerged pull request branch. This is where the lint checks are run.This mismatch of dependencies and code can cause quite a bit of confusion when you don't realize what's happening. It seems that the reason that the PR branch is checked out is that
lint-action
needs this to be able to push to the branch. We do not, however, use this functionality.Would it be possible to disable the checkout unless
auto_fix
is set to true?The text was updated successfully, but these errors were encountered: