Skip to content

Determining if reviewdog is working in GitHub Actions or not is broken because of runner's regression #708

@polamjag

Description

@polamjag

reviewdog checks for GITHUB_ACTION context variable in order to determine it's running in GitHub Actions or not.

// IsInGitHubAction returns true if reviewdog is running in GitHub Actions.
func IsInGitHubAction() bool {
// https://help.github.com/en/articles/virtual-environments-for-github-actions#default-environment-variables
return os.Getenv("GITHUB_ACTION") != ""
}

However GITHUB_ACTION context variable has become empty in recent updates, so currently this check always fails.

ref. actions/runner#635

As a result, running reviewdog in GitHub Actions always fails with this error: reviewdog: cannot get repo owner from environment variable. Set CI_REPO_OWNER?.

reviewdog/cienv/cienv.go

Lines 53 to 55 in c9d205f

if owner == "" {
return nil, false, errors.New("cannot get repo owner from environment variable. Set CI_REPO_OWNER?")
}

I think this is a regression of GitHub Actions' runner, but I also think it's reasonable to mitigate this problem by checking another context variables such as GITHUB_ACTIONS like codecov/codecov-bash does:

codecov/codecov-bash#341

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions