Skip to content

feat: cd workflow template #3

feat: cd workflow template

feat: cd workflow template #3

Workflow file for this run

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