From 8012b00e889b1a2cf3015af3696d0c7cac91acf5 Mon Sep 17 00:00:00 2001 From: Aaron Zielstorff Date: Thu, 8 Aug 2024 06:31:10 +0000 Subject: [PATCH] Updates prettier CI --- .github/workflows/build-frontend.yml | 2 +- .github/workflows/lint-frontend.yml | 2 +- .github/workflows/prettier.yml | 22 +++++++++++++++------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-frontend.yml b/.github/workflows/build-frontend.yml index 618627e..ee6ed35 100644 --- a/.github/workflows/build-frontend.yml +++ b/.github/workflows/build-frontend.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: '22' + node-version: 'lts' - name: Install Dependencies run: yarn install diff --git a/.github/workflows/lint-frontend.yml b/.github/workflows/lint-frontend.yml index 120c716..3b8cd1f 100644 --- a/.github/workflows/lint-frontend.yml +++ b/.github/workflows/lint-frontend.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: '22' + node-version: 'lts' - name: Install Dependencies run: yarn install diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index d33b0ec..1fe2501 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -1,6 +1,5 @@ name: Code Formatting -# This action works with pull requests and pushes on the main branch on: pull_request: push: @@ -14,17 +13,26 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 'lts' + + - name: Install Prettier + run: | + npm install --global prettier@latest + npm install --global prettier-plugin-vue + - name: Run Prettier id: prettier-run - uses: rutajdash/prettier-cli-action@v1.0.2 - with: - config_path: ./.prettierrc + run: | + echo "prettier-output<> $GITHUB_ENV + prettier --list-different --config ./.prettierrc --ignore-path ./.prettierignore **/*.ts **/*.vue **/*.json **/*.js | tee -a $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV - # This step only runs if prettier finds errors causing the previous step to fail - # This steps lists the files where errors were found - name: Prettier Output if: ${{ failure() }} shell: bash run: | echo "The following files are not formatted:" - echo "${{steps.prettier-run.outputs.prettier_output}}" \ No newline at end of file + echo "${{ env.prettier-output }}" \ No newline at end of file