Skip to content

Commit

Permalink
chore(ci): add PR checks
Browse files Browse the repository at this point in the history
  • Loading branch information
danijelTxFusion committed Dec 18, 2023
1 parent ac31d67 commit b6463e9
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Validate
on:
pull_request:
types: [ opened, reopened, synchronize ]

permissions:
contents: read # for checkout

jobs:
lint:
name: Check code format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install dependencies
run: yarn install
- name: Prepare environment
run: yarn lint:check
commits:
name: Check commits
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install dependencies
run: yarn install -g @commitlint/cli @commitlint/config-conventional
- name: Configure
run: |
echo 'module.exports = {"extends": ["@commitlint/config-conventional"]}' > commitlint.config.js
- name: Validate
run: |
git fetch
npx commitlint \
--from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} \
--to ${{ github.event.pull_request.head.sha }} \
--verbose

0 comments on commit b6463e9

Please sign in to comment.