This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(ci/github): Update prettier action to lint and commit
- Loading branch information
Showing
1 changed file
with
16 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
name: Lint | ||
|
||
on: push | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
name: Lint (Prettier) | ||
prettier: | ||
name: Prettier | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
# Make sure the actual branch is checked out when running on pull requests | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
|
||
- name: Install dependencies | ||
run: npm ci --no-scripts | ||
|
||
- name: Run prettier | ||
run: npx prettier -c . | ||
- name: Prettify code | ||
uses: creyD/prettier_action@v4.3 | ||
with: | ||
only_changed: True | ||
commit_message: "(lint): Run prettier against ${{ github.sha }}" | ||
prettier_options: "--write ." |