Skip to content

Commit

Permalink
build: validate commits before build step
Browse files Browse the repository at this point in the history
  • Loading branch information
cherfia committed Nov 29, 2023
1 parent 0369538 commit 110c55d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ jobs:
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- name: Install commitlint
run: |
yarn add conventional-changelog-conventionalcommits
yarn add commitlint@latest
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --from HEAD~1 --to HEAD --verbose
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
- run: yarn
- run: yarn lint
- run: yarn build
Expand All @@ -24,13 +34,3 @@ jobs:
name: codecov-chromiumly
fail_ci_if_error: true
verbose: true
- name: Install commitlint
run: |
npm install conventional-changelog-conventionalcommits
npm install commitlint@latest
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --from HEAD~1 --to HEAD --verbose
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

0 comments on commit 110c55d

Please sign in to comment.