Skip to content

Commit

Permalink
chore(ci): run pre-commit on PR's only (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
hutchic authored Apr 3, 2022
1 parent cd36b79 commit 9b9c949
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@ name: pre-commit

on: # yamllint disable-line rule:truthy
pull_request:
push:
branches:
- main

jobs:
lint-pr-title:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v3
- name: install shfmt
run: |
mkdir -p $GITHUB_WORKSPACE/bin
curl -L -s -o $GITHUB_WORKSPACE/bin/shfmt https://github.com/mvdan/sh/releases/download/v3.1.2/shfmt_v3.1.2_linux_amd64
chmod +x $GITHUB_WORKSPACE/bin/shfmt
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
python-version: '3.8'
- run: pip install 'virtualenv<20.11.0'
- uses: pre-commit/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 9b9c949

Please sign in to comment.