Skip to content
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
15 changes: 15 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
set -eu

subject=$(head -n 1 "$1")
pattern='^de\((python|sql|dsa|pyspark|kafka|databricks|system-design)\): \[(prep|project)\] ([^[:space:]].*[^[:space:]]|[^[:space:]])$'
if ! printf '%s\n' "$subject" | grep -Eq "$pattern"; then
cat >&2 <<'EOF'
Invalid commit subject. Use:
de(<python|sql|dsa|pyspark|kafka|databricks|system-design>): [<prep|project>] <short description>
Example:
de(sql): [prep] solve rolling revenue query
See https://github.com/minhazalam/data-engineering-interview-prep/blob/main/docs/commit-message-policy.md for setup and details.
EOF
exit 1
fi
14 changes: 14 additions & 0 deletions .github/workflows/de-commit-policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Validate DE commit messages

on:
pull_request:

permissions:
contents: read

jobs:
validate:
uses: minhazalam/data-engineering-interview-prep/.github/workflows/validate-de-commit-messages.yml@1fe4838abed2fefeb5e118eb713e1439e9a328e9
with:
base: ${{ github.event.pull_request.base.sha }}
head: ${{ github.event.pull_request.head.sha }}
Loading