Skip to content

Commit

Permalink
ci: add commitlint & code check workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
lingbopro committed Dec 7, 2024
1 parent 8154d2d commit 7130063
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/code-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Code Check

on:
push:
pull_request:

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
prettier:
name: Prettier Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run Prettier
id: prettier-run
uses: rutajdash/[email protected]
with:
config_path: ./.prettierrc
- name: Prettier Output
if: ${{ failure() }}
shell: bash
run: |
echo "The following files are not formatted:"
echo "${{steps.prettier-run.outputs.prettier_output}}"
18 changes: 18 additions & 0 deletions .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Commitlint

on:
push:
pull_request:

jobs:
commitlint:
name: Commitlint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
sparse-checkout: |
commitlint.config.js
- name: Run commitlint
uses: dafnik/commitlint@v1

0 comments on commit 7130063

Please sign in to comment.