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