Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Run shellcheck with reviewdog

License

NotificationsYou must be signed in to change notification settings

reviewdog/action-shellcheck

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Image CIdepupreleaseGitHub release (latest SemVer)action-bumpr supported

This action runsshellcheck withreviewdog on pull requests to improvecode review experience.

github-pr-check samplegithub-pr-review sample

Inputs

github_token

Optional.${{ github.token }} is used by default.

level

Optional. Report level for reviewdog [info,warning,error].It's same as-level flag of reviewdog.

reporter

Reporter of reviewdog command [github-pr-check,github-pr-review,github-check].Default is github-pr-check.github-pr-review can use Markdown and add a link to rule page in reviewdog reports.

filter_mode

Optional. Filtering mode for the reviewdog command [added,diff_context,file,nofilter].Default isfile.

fail_level

Optional. If set tonone, always use exit code 0 for reviewdog.Otherwise, exit code 1 for reviewdog if it finds at least 1 issue with severity greater than or equal to the given level.Possible values: [none,any,info,warning,error]Default isnone.

fail_on_error

Deprecated, usefail_level instead.Optional. Exit code for reviewdog when errors are found [true,false]Default isfalse.

reviewdog_flags

Optional. Additional reviewdog flags

path

Optional. Base directory to run shellcheck. Same as[path] offind command. Default:.

Directories are separated by lines. e.g.:

path:|  tools  src

pattern

Optional. File patterns of target files. Same as-name [pattern] offind command. Default:*.sh

Patterns are separated by lines. e.g.:

pattern:|  *.bash  *.sh

exclude

Optional. Exclude patterns of target files. Same as-not -path [exclude] offind command. Default:*/.git/*

Patterns are separated by lines. e.g.:

exclude:|  */.git/*  ./.cache/*

check_all_files_with_shebangs

Optional. Checks all files with shebangs in the repository even if they do not matchpattern.Default isfalse.

shellcheck_flags

Optional. Flags of shellcheck command. Default:--external-sources

Example usage

name:reviewdogon:[pull_request]jobs:shellcheck:name:runner / shellcheckruns-on:ubuntu-lateststeps:      -uses:actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683# v4.2.2      -name:shellcheckuses:reviewdog/action-shellcheck@5ebd09ddbe2ebb471646ce234c6c8dd18663ca7c# v1.30.0with:github_token:${{ secrets.github_token }}reporter:github-pr-review# Change reporter.path:"."# Optional.pattern:"*.sh"# Optional.exclude:"./.git/*"# Optional.check_all_files_with_shebangs:"false"# Optional.

Permissions

It is recommended to add explicitpermissionsto the workflow file so the scope of theGITHUB_TOKEN passed toaction-shellcheck is as narrow aspossible. The required permissions foraction-shellcheck to read the contents of a PR and post reviewcomments to it, is:

permissions:contents:readpull-requests:writechecks:write

Known issue

Runningshellcheck.exe on Windows might fail with the following error:

SC1017: Literal carriage return. Run script through tr -d '\r'

This is due to the presence of a carriage return character (\r) in the script.

To fix this, you can simply create or edit the.gitattributes file in the root of your repository with the following contents:

*.sh text eol=lf

This would ensure that the scripts are checked out with the correct line ending.

Sponsor this project

  •  

Packages

No packages published

Contributors16

Languages


[8]ページ先頭

©2009-2025 Movatter.jp