Skip to content

feat(ci): adds more CI validations, introduces semantic release (#74) #26

feat(ci): adds more CI validations, introduces semantic release (#74)

feat(ci): adds more CI validations, introduces semantic release (#74) #26

Workflow file for this run

name: Commit Lint
on:
- pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
HUSKY: 0
jobs:
commit-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
ref: main
- name: Fetch other branches for commitlint
run: git fetch --prune --unshallow
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.0.0
# cache: npm
# - name: Restore node_modules cache
# id: deps-cache
# uses: martijnhols/actions-cache/restore@v3
# with:
# path: node_modules
# key: ${{ runner.os }}-build-ts-deps-cache-${{ hashFiles('ts/package-lock.json') }}
- name: Install dependencies
run: npm install
- name: Install commitlint
run: |
npm install conventional-changelog-conventionalcommits
npm install commitlint@latest
- name: Validate PR commits with commitlint
id: commitlint
continue-on-error: true
run: |
output=$(npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} 2>&1) || true
echo "results<<EOF"$'\n'"$output"$'\n'EOF >> "$GITHUB_OUTPUT"
- name: Create comment
if: steps.commitlint.outputs.results
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
${{ steps.commitlint.outputs.results }}
- name: Cache node modules
if: steps.deps-cache.outputs.cache-hit != 'true'
uses: martijnhols/actions-cache/save@v3
with:
path: node_modules
key: ${{ runner.os }}-build-ts-deps-cache-${{ hashFiles('ts/package-lock.json') }}