Generate references for actions and workflows #34
Workflow file for this run
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: Pre-Commit Check | |
on: | |
pull_request: | |
jobs: | |
pre-commit-check: | |
runs-on: ubuntu-latest | |
steps: | |
# - name: Check if Pre-Commit Ran Locally | |
# run: | | |
# if [ -f .git/COMMIT_EDITMSG ]; then | |
# echo "Pre-Commit were not run locally. Please run 'pre-commit run --all-files' locally before committing." | |
# exit 1 | |
# else | |
# echo "Pre-Commit were run locally. Proceeding with the workflow." | |
# fi | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pre-commit | |
- name: Check if pre-commit ran locally | |
run: | | |
if git rev-parse --verify ${{ github.ref }} >/dev/null 2>&1; then | |
# if git rev-parse --verify HEAD >/dev/null 2>&1; then | |
echo "Checking if pre-commit ran locally..." | |
if [ -f .pre_commit_ran ]; then | |
echo "Pre-commit checks were run locally." | |
else | |
echo "Pre-commit checks were not run locally. Please run 'pre-commit run --all-files' before pushing." | |
exit 1 | |
fi | |
else | |
echo "This is not a push to a branch. Skipping pre-commit check." | |
fi |