fix: checkout merge base for cherry diff #80
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: Prevent new violations | |
on: | |
pull_request: | |
jobs: | |
cherry_diff: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # fetches all commits from all branches | |
ref: ${{ github.head_ref }} # checks out the branch that triggered the workflow | |
- name: Install dependencies | |
run: npm install | |
- name: Raise if new JavaScript code is added | |
run: ./bin/cherry.js diff --metric='[loc] JavaScript' --error-if-increase --quiet |