From faffd6b57c15cc81cbcac115822b9dd379c3728d Mon Sep 17 00:00:00 2001 From: Nicholas Carrigan Date: Sat, 4 Dec 2021 09:26:43 -0800 Subject: [PATCH] chore(tools): update prettier workflow --- .github/workflows/prettier-lint-check.yml | 34 +++++++++++++++-------- .prettierrc.json | 1 - .prettierrc.yml | 10 ------- 3 files changed, 22 insertions(+), 23 deletions(-) delete mode 100644 .prettierrc.json diff --git a/.github/workflows/prettier-lint-check.yml b/.github/workflows/prettier-lint-check.yml index a071215e..73c29d53 100644 --- a/.github/workflows/prettier-lint-check.yml +++ b/.github/workflows/prettier-lint-check.yml @@ -1,14 +1,25 @@ # @see https://github.com/EddieJaoudeCommunity/awesome-github-profiles/issues/173 -name: Prettier Lint checker to find any syntax/spacing/best practices tweaks. +name: Prettier # @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags # "Push" is every commit to any branch, whilst "pull_request" includes update commits to PRs. -on: [push, pull_request] +on: + push: + branches: + - main + pull_request: + branches: + - main jobs: prettier: + name: Prettier Linting runs-on: ubuntu-latest + strategy: + matrix: + node-version: [14.x] + steps: - name: Checkout uses: actions/checkout@v2 @@ -18,14 +29,13 @@ jobs: # This is important to fetch the changes to the previous commit fetch-depth: 0 - - name: Prettify code - uses: creyD/prettier_action@v3.1 + - name: Load Node.js + uses: actions/setup-node@v2 with: - # We only check ONLY_CHANGED as this is a PR action - only_changed: True - # We specify the prettier checker to not automatically overwrite the files. - dry: True - # This defaults to only "**/*.js", so we specify what we have as file extensions here. - prettier_options: --write **/*.{md,json,yml,yaml} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + node-version: ${{ matrix.node-version }} + + - name: Install Deps + run: npm ci + + - name: Run Prettier + run: npm run lint diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 0967ef42..00000000 --- a/.prettierrc.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/.prettierrc.yml b/.prettierrc.yml index 5c2ebe80..0f4487e9 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -1,11 +1 @@ tabWidth: 2 - -overrides: - # We need to respect that YAML files use 4 spaces. - - files: - - "*.yml" - - "**/*.yml" - - "*.yaml" - - "**/*.yaml" - options: - tabWidth: 4