Skip to content

Commit

Permalink
[Task] #5 added esLint action
Browse files Browse the repository at this point in the history
for linting in pull requets
  • Loading branch information
Type-Style committed Jan 10, 2024
1 parent bbd1cf9 commit 812aee4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
name: Lint

on:
push:
branches: [ "dev" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "dev" ]
schedule:
- cron: '24 2 * * 5'
push:
branches:
- dev

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: mrdivyansh/eslint-action@v1.0.7
# GITHUB_TOKEN in forked repositories is read-only
# https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci # or yarn install
- uses: sibiraj-s/action-eslint@v3
with:
repo-token: ${{secrets.GITHUB_TOKEN}}
eslint-rc: .eslintrc.js
eslint-args: '--ignore-path=.gitignore --quiet'
extensions: 'js,jsx,ts,tsx'
annotations: true
22 changes: 22 additions & 0 deletions .github/workflows/lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Lint

on:
pull_request:
push:
branches:
- dev

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci # or yarn install
- uses: sibiraj-s/action-eslint@v3
with:
eslint-args: '--ignore-path=.gitignore --quiet'
extensions: 'js,jsx,ts,tsx'
annotations: true

0 comments on commit 812aee4

Please sign in to comment.