Skip to content

dotenv-linter/action-dotenv-linter

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

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Action: Run dotenv-linter with reviewdog 🐶

depup release GitHub release (latest SemVer) action-bumpr supported

This action runs dotenv-linter with reviewdog on pull requests to lint .env files.

Examples

With github-pr-check

By default, with reporter: github-pr-check an annotation is added to the line:

Example comment made by the action, with github-pr-check

With github-pr-review

With reporter: github-pr-review a comment is added to the Pull Request Conversation:

Example comment made by the action, with github-pr-review

With github-code-suggestions

With reporter: github-code-suggestions a code suggestion is added to the Pull Request Conversation:

Example comment made by the action, with github-code-suggestions

Inputs

github_token

GITHUB_TOKEN. Default is ${{ github.token }}.

dotenv_linter_flags

Optional. dotenv-linter flags. (dotenv-linter <dotenv_linter_flags>)

tool_name

Optional. Tool name to use for reviewdog reporter. Useful when running multiple actions with different config.

reporter

Optional. Reporter of reviewdog command [github-pr-check, github-pr-review, github-code-suggestions]. The default is github-pr-check.

filter_mode

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

fail_level

Optional. If set to none, 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 is none.

fail_on_error

Deprecated, use fail_level instead.

reviewdog_flags

Optional. Additional reviewdog flags.

Simple check example

name: dotenv
on: [pull_request]
jobs:
  dotenv-linter:
    name: runner / dotenv-linter
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Run dotenv-linter
        uses: dotenv-linter/action-dotenv-linter@v3
        with:
          reporter: github-pr-review # Default is github-pr-check
          dotenv_linter_flags: --ignore-checks UnorderedKey

Code suggestions example

name: dotenv
on: [pull_request]
jobs:
  dotenv-linter:
    name: runner / dotenv-linter
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Run dotenv-linter with code suggestions
        uses: dotenv-linter/action-dotenv-linter@v3
        with:
          reporter: github-code-suggestions

Sponsor

Sponsored by Evrone

License

MIT

About

GitHub Action to run dotenv-linter ⚡️

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors 6

Languages