ci: add a formatting workflow (#116)

This commit is contained in:
Evo
2022-08-29 07:01:28 +05:30
committed by GitHub
parent 62bfcb1eb7
commit bc3ed918da

View File

@@ -0,0 +1,41 @@
name: Continuous Integration
on:
# Trigger the workflow on push or pull request or custom
push:
branches:
pull_request_target:
workflow_dispatch:
jobs:
Prettier:
name: Run Prettier
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Set up Node.js
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
with:
node-version: 17
# Prettier must be in `package.json`
- name: Install Node.js dependencies
run: npm i -g prettier && npm i
- name: Run Prettier
run: prettier --write .
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
commit-message: "style: pretty please"
branch: prettier
delete-branch: true
branch-suffix: short-commit-hash
title: "stlye: pretty please"
body: "pretty pretty prettier"
reviewers: EvolutionX-10