From 048c918185ee355ed43140c1f66fe036a70e2589 Mon Sep 17 00:00:00 2001 From: Diwakar Gupta <39624018+Diwakar-Gupta@users.noreply.github.com> Date: Fri, 22 Dec 2023 21:10:53 +0530 Subject: [PATCH] Create lint_format.yml --- .github/workflows/lint_format.yml | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/lint_format.yml diff --git a/.github/workflows/lint_format.yml b/.github/workflows/lint_format.yml new file mode 100644 index 0000000..105f4aa --- /dev/null +++ b/.github/workflows/lint_format.yml @@ -0,0 +1,34 @@ +name: Lint and Format Check + +on: + pull_request: + branches: + - main + push: + branches: + - main + workflow_dispatch: + inputs: + target_branch: + description: 'Target branch to run the workflow on' + required: true + +jobs: + lint_and_format: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: ${{ github.event.inputs.target_branch }} + + - name: Setup Node.js environment + uses: actions/setup-node@v2 + with: + node-version: '20' + + - name: Install dependencies + run: npm install + + - name: Lint and Format Check + run: npm run lint && npm run format