Skip to content

Commit

Permalink
chore: conditional pre-push husky hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed Oct 17, 2024
1 parent 09ad080 commit d63ef6b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,17 @@ jobs:
with:
fetch-depth: 0
- uses: './.github/actions/cache'
- uses: './.github/actions/lint-commit'
- name: install
shell: bash
run: npm i
- name: Validate current commit on push
shell: bash
if: github.event_name == 'push'
run: npx commitlint --last --verbose
- name: Validate PR commits
shell: bash
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
release:
needs: [install, commitlint]
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
npm run lint && npm run test
if [ "$CI" != "true" ]; then
npm run lint && npm run test
fi

0 comments on commit d63ef6b

Please sign in to comment.