Skip to content

Commit

Permalink
add precommit check
Browse files Browse the repository at this point in the history
  • Loading branch information
mbiannaccone committed Feb 16, 2024
1 parent aa2db12 commit f8ef552
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Pre-commit

on:
merge_group:
pull_request:
branches:
- "**"

jobs:
pre-commit:
name: Enforce Pre-commit Checks
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Determine head and base sha
id: set-sha
uses: canvas-medical/workflows/.github/actions/set-sha@main

- uses: canvas-medical/workflows/.github/actions/install-python-and-poetry@main
with:
CANVAS_PYPI_USERNAME: ${{ secrets.CANVAS_PRIVATE_PYPI_READ_ONLY_USERNAME }}
CANVAS_PYPI_PASSWORD: ${{ secrets.CANVAS_PRIVATE_PYPI_READ_ONLY_PASSWORD }}

- name: Run the pre-commit hooks
uses: pre-commit/action@v3.0.0
with:
extra_args: >-
--all-files
--source ${{ steps.set-sha.outputs.base-sha }}
--origin ${{ steps.set-sha.outputs.base-sha }}
--show-diff-on-failure
--color=always
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.12
3.11

0 comments on commit f8ef552

Please sign in to comment.