GithubHelp home page GithubHelp logo

oldgalileo / action-shellcheck Goto Github PK

View Code? Open in Web Editor NEW

This project forked from reviewdog/action-shellcheck

0.0 0.0 0.0 56 KB

Run shellcheck with reviewdog

Home Page: https://github.com/marketplace?type=actions&query=reviewdog

License: MIT License

Shell 100.00%

action-shellcheck's Introduction

GitHub Action: Run shellcheck with reviewdog

Docker Image CI depup release GitHub release (latest SemVer) action-bumpr supported

This action runs shellcheck with reviewdog on pull requests to improve code review experience.

github-pr-check sample github-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 is file.

fail_on_error

Optional. Exit code for reviewdog when errors are found [true,false] Default is false.

reviewdog_flags

Optional. Additional reviewdog flags

path

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

Directories are separated by lines. e.g.:

path: |
  tools
  src

pattern

Optional. File patterns of target files. Same as -name [pattern] of find 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] of find 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 match pattern. Default is false.

shellcheck_flags

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

Example usage

name: reviewdog
on: [pull_request]
jobs:
  shellcheck:
    name: runner / shellcheck
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: shellcheck
        uses: reviewdog/action-shellcheck@v1
        with:
          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.

Known issue

Running shellcheck.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.

action-shellcheck's People

Contributors

github-actions[bot] avatar grische avatar haya14busa avatar jackton1 avatar lucianposton avatar mgrachev avatar oldgalileo avatar renovate-bot avatar review-dog avatar shogo82148 avatar slamdunk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.