From 18a4e6f65f5cbede7b5d789fd71b7c5d99b0640d Mon Sep 17 00:00:00 2001 From: Pradumna saraf Date: Sat, 24 Jun 2023 23:34:16 +0530 Subject: [PATCH] ci: Add linter workflow --- .github/workflows/linter.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/prettier.yml | 3 ++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/linter.yml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..ff920a9 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,29 @@ +name: Unit Tests + Lint + +on: + workflow_dispatch: + push: + paths: + - "**.js" + pull_request: + paths: + - "**.js" + +jobs: + tests: + runs-on: ubuntu-latest + + steps: + - name: Checking and cloning the repo + uses: actions/checkout@v3 + + - name: Node Instllation + uses: actions/setup-node@v3 + with: + node-version: "18" + + - name: Install dependencies + run: npm ci + + - name: Run lint + run: npm run lint diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index cff49e9..39f9710 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -9,6 +9,7 @@ jobs: steps: - name: Chekout Repo uses: actions/checkout@v3 + - name: Node Setup uses: actions/setup-node@v3 with: @@ -16,7 +17,7 @@ jobs: - name: Install Dependencies run: npm ci - name: Prettier - run: npx prettier --check '**/*.js' '*.{js,md}' + run: npx prettier --write '**/*.js' '*.{js,md}' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: stefanzweifel/git-auto-commit-action@v4