Skip to content

Commit

Permalink
Add a workflow to verify Prettier formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
James M. Greene authored and James M. Greene committed Aug 5, 2022
1 parent 5c1535b commit 4036d0f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/check-formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Checking formatting

on:
push:
branches:
- main
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.JS
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Verify formatting
run: npm run format:check
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"description": "A GitHub Action to enable Pages and extract various metadata about a site. It can also be used to configure various static site generators we support as starter workflows.",
"main": "./dist/index.js",
"scripts": {
"prepare": "ncc build src/index.js -o dist --source-map --license licenses.txt",
"format": "prettier --write 'src/**/*.js'",
"format:check": "prettier --check 'src/**/*.js'",
"prepare": "npm run format && ncc build src/index.js -o dist --source-map --license licenses.txt",
"test": "jest"
},
"repository": {
Expand Down

0 comments on commit 4036d0f

Please sign in to comment.