diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..0eafcecc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + pull_request: + branches: + - master + types: [opened, synchronize, reopened] + +permissions: + contents: write + +jobs: + run-ci: + runs-on: ubuntu-latest + steps: + # Checkout Action: https://github.com/actions/checkout + - name: Checkout repository + uses: actions/checkout@v7 + + # Setup Node Action: https://github.com/actions/setup-node + - name: Set up Node.js + uses: actions/setup-node@v7 + with: + node-version: 16.x + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run Prettier + run: npm run prettier + + # Auto Commit Action Repo: https://github.com/stefanzweifel/git-auto-commit-action + - name: Commit and push formatting changes + uses: stefanzweifel/git-auto-commit-action@v7 + with: + commit_message: "style: auto-format code with prettier" + commit_user_name: "github-actions[bot]" + commit_user_email: "github-actions[bot]@users.noreply.github.com" + + - name: Run ESLint + run: npm run lint