WIP #490
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Testing | |
on: | |
push: | |
jobs: | |
commitlint: | |
# | |
# ensures commit messages follow conventional commits | |
# | |
runs-on: ubuntu-latest | |
steps: | |
# checkout the commits to lint. | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install required dependencies | |
run: | | |
apt update && apt install --yes sudo | |
sudo apt install --yes --no-install-recommends git | |
sudo apt install --yes --no-install-recommends npm curl | |
# need to update nodejs because with ubuntu's default nodejs version we would get this error: | |
# ``` | |
# + npx commitlint --from HEAD~1 --to HEAD --verbose | |
# /__w/conventions/conventions/node_modules/typescript/lib/typescript.js:139 | |
# for (let i = startIndex ?? 0; i < array.length; i++) { | |
# ^ | |
# | |
# SyntaxError: Unexpected token '?' | |
# at wrapSafe (internal/modules/cjs/loader.js:915:16) | |
# ... | |
# ``` | |
sudo npm install --global n | |
sudo n lts | |
# Install needed libraries to lint commits. | |
- run: npm install --save-dev @commitlint/{config-conventional@v18.6.0,cli} | |
# Lint the commits. | |
- run: npx commitlint --from=${{ github.event.pull_request.base.sha }} |