Skip to content

Commit

Permalink
chore: move commitlint to CI check
Browse files Browse the repository at this point in the history
  • Loading branch information
chanceaclark committed Aug 16, 2024
1 parent efed55f commit 08e7c3e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 13 deletions.
39 changes: 39 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,42 @@ jobs:
paths:
- packages/docs/.next

commitlint:
<<: *default_executor

steps:
- pre-setup
- run:
name: "Set Pull Request Variables"
command: |
DEFAULT_BRANCH=$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)
if [ "$CIRCLE_PULL_REQUEST" ]; then
git fetch origin refs/pull/${CIRCLE_PULL_REQUEST##*/}/merge
BASE_SHA1=`git rev-parse FETCH_HEAD^1`
elif [ "$DEFAULT_BRANCH" ]; then
echo "Not a pull request, so getting merge base from default branch $DEFAULT_BRANCH instead."
BASE_SHA1=$DEFAULT_BRANCH
fi
if [ -z "$BASE_SHA1" ]; then
echo 'Not a pull request and could not identify default branch, skipping.'
exit 0
fi
MERGE_BASE_SHA1=`git merge-base $BASE_SHA1 $CIRCLE_SHA1`
echo "export BASE_SHA1=${BASE_SHA1}" >> $BASH_ENV
echo "export MERGE_BASE_SHA1=${MERGE_BASE_SHA1}" >> $BASH_ENV
- run:
name: Validate Commits
command: |
if [ -z "$MERGE_BASE_SHA1" ]; then
exit 0;
fi
pnpm commitlint --from ${MERGE_BASE_SHA1} --to ${CIRCLE_SHA1} --verbose
typecheck:
<<: *default_executor

Expand Down Expand Up @@ -157,6 +193,9 @@ workflows:
version: 2
build_and_test:
jobs:
- commitlint:
<<: *filter_branch

- build-icons:
<<: *filter_branch

Expand Down
1 change: 0 additions & 1 deletion .husky/commit-msg

This file was deleted.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"lint": "eslint . --ext .ts,.tsx,.js,.mdx --max-warnings 0",
"start": "turbo start --filter @bigcommerce/docs",
"test": "turbo test",
"typecheck": "turbo typecheck",
"prepare": "husky"
"typecheck": "turbo typecheck"
},
"prettier": "@bigcommerce/eslint-config/prettier",
"devDependencies": {
Expand All @@ -23,7 +22,6 @@
"@types/babel__standalone": "^7.1.4",
"eslint": "^8.33.0",
"eslint-plugin-mdx": "^3.1.5",
"husky": "^9.0.11",
"lerna": "^8.1.2",
"turbo": "^2.0.14",
"typescript": "^5.4.5"
Expand Down
9 changes: 0 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 08e7c3e

Please sign in to comment.