Skip to content

chore: add contributing guide #79

chore: add contributing guide

chore: add contributing guide #79

Workflow file for this run

name: Lint PR
on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']
branches:
- staging
jobs:
commitlint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18 ]
defaults:
run:
working-directory: ${{ github.workspace }}
steps:
- uses: actions/checkout@v3
with:
# we need + 1 commit
fetch-depth: 2
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint pull request commit message when it has a single commit
if: ${{ github.event.pull_request.commits == '1' }}
run: |
echo "Since your PR has a single commit, this commit should adhere to the commit message convention."
echo "correct format: <type>(<scope>): <subject>"
echo "example: feat: add dialbot icon"
echo "Please amend your commit message (git commit --amend) if commitlint reports an error and push using: git push --force-with-lease"
git show -s --format=%B HEAD^2 | npx commitlint --verbose
- name: Lint pull request title
run: |
echo "The PR's title should adhere to the commit message convention."
echo "correct format: <type>(<scope>): <subject>"
echo "example: feat: add dialbot icon"
npx commitlint --verbose << EOF
${{ github.event.pull_request.title }}
EOF