Open tynes opened 3 years ago
I am observing an error running codechecks in Github Actions - Provider should never be in fork mode and not in PR mode! It appears as if there is a false positive as the PR is not coming from a fork. The code is here:
codechecks
Provider should never be in fork mode and not in PR mode!
https://github.com/codechecks/monorepo/blob/13986fee646918b63841f04bc4a2f3d0cf9c7000/packages/client/src/getExecutionContext.ts#L20-L25
For Github actions, !pr is always true
!pr
https://github.com/codechecks/monorepo/blob/ba52ad88a50898bf4ad246fd16ce5f7f7ada4034/packages/client/src/ci-providers/GithubActions.ts#L14-L16
And isFork is always true because GITHUB_HEAD_REF is set for PRs submitted from the same repo. See the docs here: https://docs.github.com/en/actions/reference/environment-variables
isFork
GITHUB_HEAD_REF
https://github.com/codechecks/monorepo/blob/ba52ad88a50898bf4ad246fd16ce5f7f7ada4034/packages/client/src/ci-providers/GithubActions.ts#L27-L31
GITHUB_HEAD_REF Only set for pull request events. The name of the head branch.
Perhaps there is a better way to determine there the PR is coming from a fork, will update if I determine a good solution
It should be fixed in: https://github.com/codechecks/monorepo/pull/81
beta released as: @codechecks/client@0.1.10-beta
@codechecks/client@0.1.10-beta
I am observing an error running
codechecks
in Github Actions -Provider should never be in fork mode and not in PR mode!
It appears as if there is a false positive as the PR is not coming from a fork. The code is here:https://github.com/codechecks/monorepo/blob/13986fee646918b63841f04bc4a2f3d0cf9c7000/packages/client/src/getExecutionContext.ts#L20-L25
For Github actions,
!pr
is always truehttps://github.com/codechecks/monorepo/blob/ba52ad88a50898bf4ad246fd16ce5f7f7ada4034/packages/client/src/ci-providers/GithubActions.ts#L14-L16
And
isFork
is always true becauseGITHUB_HEAD_REF
is set for PRs submitted from the same repo. See the docs here: https://docs.github.com/en/actions/reference/environment-variableshttps://github.com/codechecks/monorepo/blob/ba52ad88a50898bf4ad246fd16ce5f7f7ada4034/packages/client/src/ci-providers/GithubActions.ts#L27-L31
Perhaps there is a better way to determine there the PR is coming from a fork, will update if I determine a good solution