Skip to content

Commit

Permalink
Merge pull request #6 from woaitsAryan/master
Browse files Browse the repository at this point in the history
feat: added commit linter
  • Loading branch information
woaitsAryan authored Apr 9, 2024
2 parents c2587a8 + df2e66b commit 92d8977
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Continous integration

on: [push, pull_request]

jobs:
build_and_lint:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install commitlint
run: |
npm i -g @commitlint/config-conventional @commitlint/cli
- name: Install dependancies and build
run: |
if [ -f package.json ]; then
npm ci
npm run build
else
echo "package.json not found, skipping build step"
fi
shell: bash

- name: Validate commit messages
if: github.event_name == 'push'
run: |
commitlint -x @commitlint/config-conventional --from HEAD~1 --to HEAD --verbose
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: commitlint -x @commitlint/config-conventional --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

0 comments on commit 92d8977

Please sign in to comment.