Skip to content

Commit

Permalink
ci(build): fix commit range in commit message linting (#2956)
Browse files Browse the repository at this point in the history
Co-authored-by: Vladimír Gorej <vladimir.gorej@smartbear.com>
  • Loading branch information
frantuma and char0n committed Jul 17, 2023
1 parent c46ae6a commit c46a02d
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ env:
CPU_CORES: 2

jobs:
lint:
lint-commit-messages:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # necessary for linting commit messages
ref: ${{ github.event.pull_request.head.sha }} # necessary to check out pull request HEAD commit instead of merge commit
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
Expand All @@ -28,11 +29,26 @@ jobs:
cache-dependency-path: 'package-lock.json'
- name: Install dependencies
run: npm ci
- name: Lint code
run: npm run lint
- name: Lint commit message
if: github.ref != 'refs/heads/main' && github.actor != 'dependabot[bot]'
run: npx commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD
run: |
npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- name: Install dependencies
run: npm ci
- name: Lint code
run: npm run lint

check-typescript-types:
runs-on: ubuntu-latest
Expand Down

0 comments on commit c46a02d

Please sign in to comment.