Skip to content

fix2

fix2 #133

Workflow file for this run

name: ci
on:
pull_request: # Start the job on all PRs
push:
branches:
- master
- main
jobs:
precommit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-
restore-keys: |
${{ runner.os }}-pip-
- name: Cache shfmt binary
uses: actions/cache@v3
with:
path: /usr/local/bin/shfmt
key: ${{ runner.os }}-shfmt-
restore-keys: |
${{ runner.os }}-shfmt-
- name: Cache Pre-Commit environments
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pc-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pc-${{ hashFiles('.pre-commit-config.yaml') }}
${{ runner.os }}-pc-
- name: Install dependencies
run: |
make setuppc
- name: Run pre-commits
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
echo "Default branch = $DEFAULT_BRANCH"
echo "Current SHA = ${{ github. sha }}"
pre-commit run --from-ref origin/$DEFAULT_BRANCH --to-ref "${{ github. sha }}"