mirror of
https://github.com/microsoft/autogen.git
synced 2026-04-20 03:02:16 -04:00
adding precommit check (#930)
* adding precommit check * run precommit * Apply suggestions from code review Co-authored-by: Zvi Baratz <z.baratz@gmail.com> * apply precommit --------- Co-authored-by: Zvi Baratz <z.baratz@gmail.com>
This commit is contained in:
26
.github/workflows/pre-commit.yml
vendored
Normal file
26
.github/workflows/pre-commit.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: Code formatting
|
||||
|
||||
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
|
||||
on: # Trigger the workflow on push or pull request, but only for the main branch
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request: {}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
|
||||
pre-commit-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
- name: Set $PY environment variable
|
||||
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cache/pre-commit
|
||||
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
|
||||
- uses: pre-commit/action@v3.0.0
|
||||
Reference in New Issue
Block a user