diff --git a/Dockerfile b/Dockerfile index 1f4b30c..714a51e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -From ubuntu:18.04 +FROM alpine:3.10.3 -RUN apt-get update \ - && apt-get install -qy shellcheck +RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories; \ + apk update && apk add --no-cache shellcheck bash COPY entrypoint.sh /entrypoint.sh diff --git a/README.md b/README.md index 51375cb..180da21 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,57 @@ -# Magic Shell Linter Action +# Shell Linter -This action executes lint check on bash scripts -
- -## Inputs - -### `path` +A GitHub Action that performs static analysis for shell scripts using [ShellCheck](https://github.com/koalaman/shellcheck). -Required. Path to the bash script. +![](docs/images/preview.png)
-## Example usage +## Usage +Shell Linter can perform static analysis in various ways. You can use it to lint all the shell scripts in your project or lint a a specific file or folder using the `path` parameter. Specific use cases are shown below: + +Run static analysis for all of the shell scripts. ```yml jobs: - # Run job that executes the bash script lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: Lint check - uses: azohra/magic-shell-linter-action@master + uses: azohra/shell-linter@v0.1.0 +``` + +Run static analysis for a single shell script. +```yml + - name: Lint check + uses: azohra/shell-linter@v0.1.0 + with: + path: "setup.sh" +``` + +Run static analysis for multiple shell scripts. +```yml + - name: Lint check + uses: azohra/shell-linter@v0.1.0 with: - path: "template.sh" + path: "setup.sh,deploy.sh" ``` + + +Run static analysis for all the shell scripts in a folder. +```yml + - name: Lint check + uses: azohra/shell-linter@v0.1.0 + with: + path: "src" +``` + +
+ +## Input + +### `path` + +Optional. Execute lint check on a specific file or folder. Default: `.` + diff --git a/action.yml b/action.yml index 8751378..d50f5f8 100644 --- a/action.yml +++ b/action.yml @@ -1,12 +1,15 @@ -name: 'Magic Shell Linter' -description: 'Execute lint check on Bash scripts' +name: 'Shell Linter' +description: 'Execute lint check on shell scripts using ShellCheck' author: 'ep-mobile' inputs: path: - description: 'Path to the bash scripts that need the lint check.' + description: 'Execute lint check on a specific file or folder.' required: false runs: using: 'docker' image: 'Dockerfile' args: - - ${{ inputs.path }} \ No newline at end of file + - ${{ inputs.path }} +branding: + icon: 'check-circle' + color: 'green' \ No newline at end of file diff --git a/docs/images/preview.png b/docs/images/preview.png new file mode 100644 index 0000000..138757a Binary files /dev/null and b/docs/images/preview.png differ