Skip to content
This repository was archived by the owner on Jul 28, 2024. It is now read-only.

Commit 082f52c

Browse files
author
Nicholas Carrigan (he/him)
authored
chore(tools): update prettier workflow (#881)
1 parent 02395e8 commit 082f52c

File tree

3 files changed

+22
-23
lines changed

3 files changed

+22
-23
lines changed
Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
# @see https://github.com/EddieJaoudeCommunity/awesome-github-profiles/issues/173
2-
name: Prettier Lint checker to find any syntax/spacing/best practices tweaks.
2+
name: Prettier
33

44
# @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags
55
# "Push" is every commit to any branch, whilst "pull_request" includes update commits to PRs.
6-
on: [push, pull_request]
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
branches:
12+
- main
713

814
jobs:
915
prettier:
16+
name: Prettier Linting
1017
runs-on: ubuntu-latest
1118

19+
strategy:
20+
matrix:
21+
node-version: [14.x]
22+
1223
steps:
1324
- name: Checkout
1425
uses: actions/checkout@v2
@@ -18,14 +29,13 @@ jobs:
1829
# This is important to fetch the changes to the previous commit
1930
fetch-depth: 0
2031

21-
- name: Prettify code
22-
uses: creyD/[email protected]
32+
- name: Load Node.js
33+
uses: actions/setup-node@v2
2334
with:
24-
# We only check ONLY_CHANGED as this is a PR action
25-
only_changed: True
26-
# We specify the prettier checker to not automatically overwrite the files.
27-
dry: True
28-
# This defaults to only "**/*.js", so we specify what we have as file extensions here.
29-
prettier_options: --write **/*.{md,json,yml,yaml}
30-
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
node-version: ${{ matrix.node-version }}
36+
37+
- name: Install Deps
38+
run: npm ci
39+
40+
- name: Run Prettier
41+
run: npm run lint

.prettierrc.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierrc.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1 @@
11
tabWidth: 2
2-
3-
overrides:
4-
# We need to respect that YAML files use 4 spaces.
5-
- files:
6-
- "*.yml"
7-
- "**/*.yml"
8-
- "*.yaml"
9-
- "**/*.yaml"
10-
options:
11-
tabWidth: 4

0 commit comments

Comments
 (0)