Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload git patch when pre-commit fails #625

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,13 @@ jobs:
run: |
source .venv/bin/activate
make pre-commit-run-all
- name: Generate git patch
if: ${{ failure() }}
run: |
git diff > pre-commit.patch
- name: Upload git patch
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: git-patch
path: pre-commit.patch
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ repos:
hooks:
- id: black
name: check python formating (black)
args: ["--diff", "--check"]
# - repo: https://github.com/asottile/pyupgrade
# rev: v3.16.0
# hooks:
Expand All @@ -87,7 +88,7 @@ repos:
hooks:
- id: isort
name: check python imports order (isort)
args: ["--profile", "black", "--filter-files"]
args: ["--profile", "black", "--filter-files", "--diff", "--check-only"]
- repo: local
hooks:
- id: docker-hadolint
Expand Down
2 changes: 1 addition & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sys
from datetime import datetime, timedelta

import docker
from pyzabbix import ZabbixAPI
from twisted.internet import defer

Expand All @@ -28,6 +27,7 @@
releaseBranches,
savedPackageBranches,
)
import docker

private_config = {"private": {}}
exec(open("/srv/buildbot/master/master-private.cfg").read(), private_config, {})
Expand Down
Loading