Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

usage error #68

Closed
ligi opened this issue Jul 20, 2024 · 2 comments
Closed

usage error #68

ligi opened this issue Jul 20, 2024 · 2 comments

Comments

@ligi
Copy link

ligi commented Jul 20, 2024

I am using the action with a simple config like this:

name: prettier review
on: [pull_request]
jobs:
  prettier:
    name: runner / prettier
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: EPMatt/reviewdog-action-prettier@v1
        with:
          github_token: ${{ secrets.github_token }}
          reporter: github-pr-review
          level: error
          prettier_flags: '_data/*/*.json'

but the action fails like this:

Run EPMatt/reviewdog-action-prettier@v1
Run reviewdog/action-setup@v1
Run set -eu
🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog
Run set -eu
📖 reviewdog -h
Run $GITHUB_ACTION_PATH/script.sh
🔄 Running npm install to install prettier...
Run reviewdog/action-suggester@v1
Run set -euo pipefail
🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog
Run set -euo pipefail
📖 reviewdog -h
  Usage:	reviewdog [flags]
  	reviewdog accepts any compiler or linter results from stdin and filters
  	them by diff for review. reviewdog also can posts the results as a comment to
  	GitHub if you use reviewdog in CI service.
  Flags:
    -conf string
      	config file path
    -diff string
      	diff command (e.g. "git diff") for local reporters. Do not use --relative flag for git command.
    -efm value
      	list of supported machine-readable format and errorformat (https://github.com/reviewdog/errorformat)
    -f string
      	format name (run -list to see supported format name) for input. It's also used as tool name in review comment if -name is empty
    -f.diff.strip int
      	option for -f=diff: strip NUM leading components from diff file names (equivalent to 'patch -p') (default is 1 for git diff) (default 1)
    -fail-on-error
      	Returns 1 as exit code if any errors/warnings found in input
    -filter-mode value
      	how to filter checks results. [added, diff_context, file, nofilter].
      			"added" (default)
      				Filter by added/modified diff lines.
      			"diff_context"
      				Filter by diff context, which can include unchanged lines.
      				i.e. changed lines +-N lines (e.g. N=3 for default git diff).
      			"file"
      				Filter by added/modified file.
      			"nofilter"
      				Do not filter any results.
      	
    -guess
      	guess Pull Request ID by branch name and commit SHA
    -level string
      	default report level for supported reporters ("info","warning","error").
    -list
      	list supported pre-defined format names which can be used as -f arg
    -log-level string
      	log level for reviewdog itself. (debug, info, warning, error) (default "info")
    -name string
      	tool name in review comment. -f is used as tool name if -name is empty
    -reporter string
      	reporter of reviewdog results.
      		"local" (default)
      			Report results to stdout.
      	
      		"rdjson"
      			Report results to stdout in rdjson format.
      	
      		"rdjsonl"
      			Report results to stdout in rdjsonl format.
      	
      		"sarif"
      			Report results to stdout in SARIF format.
      	
      		"github-check"
      			Report results to GitHub Check. It works both for Pull Requests and commits.
      			For Pull Request, you can see report results in GitHub PullRequest Check
      			tab and can control filtering mode by -filter-mode flag.
      	
      			There are two options to use this reporter.
      	
      			Option 1) Run reviewdog from GitHub Actions w/ secrets.GITHUB_TOKEN
      				Note that it reports result to GitHub Actions log console for Pull
      				Requests from fork repository due to GitHub Actions restriction.
      				https://help.github.com/en/articles/virtual-environments-for-github-actions#github_token-secret
      	
      				Set REVIEWDOG_GITHUB_API_TOKEN with secrets.GITHUB_TOKEN. e.g.
      						REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      	
      			Option 2) Install reviewdog GitHub Apps
      				1. Install reviewdog Apps. https://github.com/apps/reviewdog
      				2. Set REVIEWDOG_TOKEN or run reviewdog CLI in trusted CI providers.
      				You can get token from https://reviewdog.app/gh/<owner>/<repo-name>.
      				$ export REVIEWDOG_TOKEN="xxxxx"
      	
      				Note: Token is not required if you run reviewdog in Travis CI.
      	
      		"github-pr-check"
      			Same as github-check reporter but it only supports Pull Requests.
      	
      		"github-pr-review"
      			Report results to GitHub review comments.
      	
      			1. Set REVIEWDOG_GITHUB_API_TOKEN environment variable.
      			Go to https://github.com/settings/tokens and create new Personal access token with repo scope.
      	
      			For GitHub Enterprise:
      				$ export GITHUB_API="https://example.githubenterprise.com/api/v3"
      	
      		"gitlab-mr-discussion"
      			Report results to GitLab MergeRequest discussion.
      	
      			1. Set REVIEWDOG_GITLAB_API_TOKEN environment variable.
      			Go to https://gitlab.com/profile/personal_access_tokens
      	
      			CI_API_V4_URL (defined by Gitlab CI) as the base URL for the Gitlab API automatically.
      			Alternatively, GITLAB_API can also be defined, and it will take precedence over the former:
      				$ export GITLAB_API="https://example.gitlab.com/api/v4"
      	
      		"gitlab-mr-commit"
      			Same as gitlab-mr-discussion, but report results to GitLab comments for
      			each commits in Merge Requests.
      	
      		"gerrit-change-review"
      			Report results to Gerrit Change comments.
      	
      			1. Set GERRIT_USERNAME and GERRIT_PASSWORD for basic authentication or
      			GIT_GITCOOKIE_PATH for git cookie based authentication.
      			2. Set GERRIT_CHANGE_ID, GERRIT_REVISION_ID GERRIT_BRANCH and GERRIT_ADDRESS
      	
      			For example:
      				$ export GERRIT_CHANGE_ID=myproject~master~I1293efab0[14](https://github.com/ethereum-lists/chains/actions/runs/10019933167/job/27697033254?pr=5463#step:3:16)de2
      				$ export GERRIT_REVISION_ID=ed318bf9a3c
      				$ export GERRIT_BRANCH=master
      				$ export GERRIT_ADDRESS=http://localhost:8080
      		
      		"bitbucket-code-report"
      			Create Bitbucket Code Report via Code Insights
      			(https://confluence.atlassian.com/display/BITBUCKET/Code+insights).
      			You can set custom report name with:
      	
      			If running as part of Bitbucket Pipelines no additional configurations is needed.
      			If running outside of Bitbucket Pipelines you need to provide git repo data
      			(see documentation below for local reporters) and BitBucket credentials:
      			- For Basic Auth you need to set following env variables:
      				  BITBUCKET_USER and BITBUCKET_PASSWORD
      			- For AccessToken Auth you need to set BITBUCKET_ACCESS_TOKEN
      			
      			To post results to Bitbucket Server specify BITBUCKET_SERVER_URL.
      	
      		"gitea-pr-review"
      			Report results to Gitea review comments.
      	
      			1. Set REVIEWDOG_GITEA_API_TOKEN environment variable.
      			Go to https://<gitea-server>/user/settings/applications and create new Access Token token with repo scope.
      			2. Set GITEA_ADDRESS environment variable to your Gitea server base address.
      			For example:
      				$ export GITEA_ADDRESS=http://localhost:3000
      	
      		For GitHub Enterprise and self hosted GitLab or Gitea, set
      		REVIEWDOG_INSECURE_SKIP_VERIFY to skip verifying SSL (please use this at your own risk)
      			$ export REVIEWDOG_INSECURE_SKIP_VERIFY=true
      	
      		For non-local reporters, reviewdog automatically get necessary data from
      		environment variable in CI service (GitHub Actions, Travis CI, Circle CI, drone.io, GitLab CI, Bitbucket Pipelines).
      		You can set necessary data with following environment variable manually if
      		you want (e.g. run reviewdog in Jenkins).
      	
      			$ export CI_PULL_REQUEST=14 # Pull Request number (e.g. 14)
      			$ export CI_COMMIT="$(git rev-parse @)" # SHA1 for the current build
      			$ export CI_REPO_OWNER="haya14busa" # repository owner
      			$ export CI_REPO_NAME="reviewdog" # repository name
      	 (default "local")
    -runners string
      	comma separated runners name to run in config file. default: run all runners
    -strip int
      	strip NUM leading components from diff file names (equivalent to 'patch -p') (default is 1 for git diff) (default 1)
    -tee
      	enable "tee"-like mode which outputs tools's output as is while reporting results to -reporter. Useful for debugging as well.
    -version
      	print version
  
  See https://github.com/reviewdog/reviewdog for more detail.
@ligi
Copy link
Author

ligi commented Jul 20, 2024

weird - checking other projects using the same actions it also has this output - but for me it fails:

image

@ligi
Copy link
Author

ligi commented Jul 20, 2024

seems this is a duplicate of #59
hope the PR can be merged soon

@ligi ligi closed this as completed Jul 20, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant