From d469452329faf353d4dfc7dd3821bb3d6d338b5d Mon Sep 17 00:00:00 2001 From: jalensailin Date: Mon, 28 Jul 2025 16:01:52 -0400 Subject: [PATCH] add composite action for reusable steps test action change name of node setup step push fix for format/lint check --- .github/actions/setup-node/action.yml | 14 +++++++++++++ .github/workflows/format-lint-check.yml | 28 ++++++++++++++----------- 2 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 .github/actions/setup-node/action.yml diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml new file mode 100644 index 0000000..f36e1de --- /dev/null +++ b/.github/actions/setup-node/action.yml @@ -0,0 +1,14 @@ +name: "Setup Node Project" +description: "Sets up a Node.js project" +runs: + using: "composite" + steps: + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: "22" + cache: npm + + - name: Install dependencies + run: npm ci + shell: bash diff --git a/.github/workflows/format-lint-check.yml b/.github/workflows/format-lint-check.yml index 8eb7e87..439833f 100644 --- a/.github/workflows/format-lint-check.yml +++ b/.github/workflows/format-lint-check.yml @@ -7,23 +7,27 @@ on: jobs: lint: - name: Lint and Format Check + name: Run ESLint runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: "22" - - - name: Install dependencies - run: npm ci + - uses: actions/checkout@v4 + - name: Node Setup + uses: ./.github/actions/setup-node # Set the folder - name: Run ESLint run: npm run lint + format: + name: Run Prettier Format Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Node Setup + uses: ./.github/actions/setup-node # Set the folder + - name: Check Prettier formatting run: npm run format:check + +defaults: + run: + shell: bash