Skip to content

Commit

Permalink
fix pre-commit ci action
Browse files Browse the repository at this point in the history
  • Loading branch information
thodkatz committed Oct 11, 2024
1 parent 7dc4196 commit d41e892
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
defaults:
run:
shell: bash -l {0}
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -28,13 +26,16 @@ jobs:
environment-file: environment.yml
channel-priority: flexible
miniforge-variant: Miniforge3
- name: Get the latest commit hash and target ref
run: |
echo "COMMIT_HASH=$(git log -1 --format='%H')" >> $GITHUB_ENV
echo "REF=${{ github.event.pull_request.base.ref || github.ref_name }}" >> $GITHUB_ENV
- name: Run Pre-Commit
run: |
echo $BRANCH_NAME
echo ${{ github.event.pull_request.base.ref }}
echo ${{ github.event.pull_request.head.sha }}
echo $REF
echo $COMMIT_HASH
git fetch origin
pre-commit run --from-ref origin/${{ github.event.pull_request.base.ref }} --to-ref ${{ github.event.pull_request.head.sha }}
pre-commit run --from-ref origin/$REF --to-ref $COMMIT_HASH
test-dev:
runs-on: ubuntu-latest
Expand Down

0 comments on commit d41e892

Please sign in to comment.