Skip to content

Commit c16efaf

Browse files
committed
ci: turn on pre-commit checks for fresh code
Enable static code checks in the CI pipeline for new code changes. Closes #TNTP-2939
1 parent 14d3c1b commit c16efaf

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

.github/actions/static-code-check/action.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@ runs:
2525
echo "Found base branch with hash: '${HASH}'"
2626
echo "BASE_BRANCH=${HASH}" >> ${GITHUB_ENV}
2727
28-
# FIXME: Enable golangci-lint-diff after PR #1173 is merged.
29-
# - name: pre-commit checks (diff)
30-
# uses: pre-commit/[email protected]
31-
# env:
32-
# SKIP: golangci-lint-full
33-
# with:
34-
# extra_args: --all-files --from-ref=${{ env.BASE_BRANCH }} --to-ref=HEAD --hook-stage=manual
28+
- name: pre-commit checks (diff)
29+
uses: pre-commit/[email protected]
30+
env:
31+
SKIP: golangci-lint-full
32+
with:
33+
extra_args: --all-files --from-ref=${{ env.BASE_BRANCH }} --to-ref=HEAD --hook-stage=manual
3534

3635
- name: pre-commit checks (full)
3736
uses: pre-commit/[email protected]

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ repos:
117117
pass_filenames: false
118118
always_run: true
119119
entry: >-
120-
bash -c "golangci-lint run --new-from-rev=${GITHUB_BASE_REF:-master}
120+
bash -c "golangci-lint run --new-from-rev=${BASE_BRANCH:-master}
121121
--config=golint-precommit.yml --allow-parallel-runners"
122122
additional_dependencies:
123123
- github.com/golangci/golangci-lint/v2/cmd/[email protected]

0 commit comments

Comments
 (0)