stefanoeb/eslint-action

Usage: main.workflow

raineorshine opened this issue · 3 comments

I am still a bit confused on usage.

https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-a-workflow makes no reference to main.workflow and instead seems to imply that everything goes in a .yml file in /.github/workflows/.

Can you clarify how to use this action?

I was confused by that as well. My config looks like this now and it works:

- name: Run ESLint
  uses: stefanoeb/eslint-action@1.0.0
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

What I'm unsure is how to specify the "args" option in a yaml file. It triggers an error if I try to use it together with the uses keyword.

I was confused by that as well. My config looks like this now and it works:

- name: Run ESLint
  uses: stefanoeb/eslint-action@1.0.0
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

What I'm unsure is how to specify the "args" option in a yaml file. It triggers an error if I try to use it together with the uses keyword.

You have to specify the args option with "with" first. Example:

      - name: Run ESLint action
        uses: stefanoeb/eslint-action@1.0.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          args: './src/**/*.{js,ts,tsx} --max-warnings 0' 

Thanks! There was a missing brace, but once I added that it worked!

      - uses: stefanoeb/eslint-action@1.0.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          args: './src/**/*.{js,ts,tsx} --max-warnings 0'