Skip to content

Commit 16319bf

Browse files
author
Sunil Thaha
authored
Merge pull request #2163 from vprashar2929/ci-commlint
ci: ensure commit-msg precommit runs pr checks
2 parents 3455ce2 + e5586df commit 16319bf

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/pr-checks.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,23 @@ jobs:
106106
steps:
107107
- name: Checkout source
108108
uses: actions/checkout@v3
109+
with:
110+
ref: ${{ github.event.pull_request.head.sha }}
109111

110112
- name: Setup Python
111113
uses: actions/setup-python@v3
112114

113-
- name: Setup Pre-Commit
114-
uses: pre-commit/[email protected]
115+
- name: Setup Pre-commit
116+
run: pip install pre-commit
117+
118+
- name: Run Pre-commit
119+
run: pre-commit run --all-files
120+
121+
- name: Run Commitlint
122+
run: |
123+
COMMIT_MSG=$(git log -1 --pretty=%B)
124+
echo "$COMMIT_MSG" > .git/COMMIT_EDITMSG
125+
pre-commit run commitlint --hook-stage commit-msg --commit-msg-file .git/COMMIT_EDITMSG
115126
116127
build-images:
117128
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)